<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <title>报告详情</title>
    <meta charset="utf-8">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <link rel="stylesheet" href="/dist/plugins/fixedTable/fixed-table.css"/>


    <style type="text/css">
        .table {
            margin-top: 0px;
            margin-bottom: 0px;
            color: rgb(51, 51, 51);
            border-right-width: 0px !important;
            border-bottom-with: 0px !important;
            table-layout: auto;
        }

        .table th {
            margin-top: 0px;
            margin-bottom: 0px;
            color: rgb(51, 51, 51);
            border-right: 1px solid #DEDEDE !important;
            border-bottom: 1px solid #DEDEDE !important;
            border-left-width: 0px !important;
            border-top-with: 0px !important;
        }

        .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
            vertical-align: middle;
            padding: 0;
            height: 24px;
            line-height: 100%;

        }

        table .td-title {
            background-color: #f8f8f8;
            line-height: 24px;
            font-weight: bold;
        }

        table .td-title2 {
            line-height: 24px;
            font-weight: bold;
        }

        table .td-module {
            background: yellow !important;
            line-height: 24px;
            font-weight: bold;
        }

        .table > tbody > tr > td.td-row2 {
            height: 56px;
            line-height: 20px;
            max-height: 56px;
            overflow: hidden;
        }

        .table > tbody > tr > td.td-row2 span {
            max-height: 44px;
            line-height: 22px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        .table > tbody > tr > td.td-row3 {
            height: 56px;
            line-height: 18px;
            max-height: 56px;
            overflow: hidden;
        }

        .table > tbody > tr > td.td-row3 span {
            max-height: 56px;
            line-height: 18px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
        }

        .td-value span.lineOne {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .td-value1 span.lineOne {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .divOne {
            max-height: 27px;
            line-height: 27px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        input[type=text], input[type=tel], input[type=number], select {
            box-sizing: border-box;
            border-width: 0px;
            border-style: none;
            padding-right: 0px !important;
            padding-top: 0px !important;
            padding-bottom: 0px !important;
            margin-left: 0px !important;
            margin-right: 0px !important;
            margin-top: 0px !important;
            margin-bottom: 0px !important;
            padding-left: 6px;
        }

        input[type=text], input[type=tel], input[type=number], select {
            height: 24px;
            width: 100%;
            border: none;
            outline: none;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .table .td-value span, .table .td-value input[type="text"], .td-value {
            vertical-align: middle;
            word-wrap: break-word;
            color: #2a8cec !important;
        }

        textarea {
            height: 56px;
            width: 100%;
            border: none;
            outline: none;
            -webkit-appearance: none;
            resize: none;
            padding-top: 20px;
            padding-left: 20px;
        }

        .width90 {
            width: 96px;
        }

        .width100 {
            width: 170px;
            overflow: hidden;
            word-wrap: break-word;
        }

        .width120 {
            width: 180px;
        }

        .width92 {
            width: 102px;
        }

        .width120 {
            width: 160px;
        }

        .width95 {
            width: 89px;
        }

        .width93 {
            width: 96px;
        }

        .width60 {
            width: 60px;
        }

        .span-a-btn {
            position: absolute;
            right: 10px;
            margin-right: 19px;
        }

        .a-btn {
            color: black;
        }

        .userbox {
            border: 1px #BBBBBB solid;
            background-color: White;
            width: 99%;
            overflow: hidden;
        }

        div.userbox {
            min-height: 21px;
            padding-left: 6px;
            padding-top: 6px;
            height: auto;
        }

        input.userbox {
            height: 21px;
            padding-left: 6px;
            line-height: 21px;
        }

        .userbox input {
            border-width: 0px;
            border-style: none;
            width: 280px;
        }

        .user {
            height: 20px;
            line-height: 20px;
            max-height: 20px;
            float: left;
            text-align: left;
            min-width: 32px;
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }

        .user:hover {
            background-color: #cfd4d1;
        }

        .userbox .over.user {
            background-color: #cfd4d1;
        }

        .userbox .select.user {
            color: #fff;
            background-color: #045B9E;
        }

        .saveAddress {
            width: 400px;
            height: 200px;
            position: fixed;
            top: 50%;
            left: 50%;
            margin-left: -200px;
            margin-top: -100px;
            background: #fff;
            border-radius: 10px;
            z-index: 1978;
            display: none;
            border: 1px solid #cfcfcf;
        }

        .saveModle {
            width: 500px;
            height: 300px;
            position: fixed;
            top: 50%;
            left: 50%;
            margin-left: -250px;
            margin-top: -150px;
            background: #fff;
            border-radius: 10px;
            z-index: 1978;
            display: none;
            border: 1px solid #cfcfcf;
        }

        .saveModle .top, .saveAddress .top {
            height: 34px;
            line-height: 34px;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            /* padding-left: 7px; */
            border-bottom: 1px solid #cfcfcf;
            background: #f5f5f5;
            border-top-left-radius: 10px;
            border-top-right-radius: 10px;
        }

        .saveModle .top .title, .saveAddress .top .title {
            height: 32px;
            line-height: 32px;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            /* float: left; */
            background: #F5F5F6;
            text-align: center;
            border-top-left-radius: 10px;
            border-top-right-radius: 10px;
        }

        .saveModle .top .btn, .saveAddress .top .btn {
            font-size: 20px;
            width: 34px;
            height: 22px;
            line-height: 12px;
            position: absolute;
            right: 0;
            top: 0px;
        }

        .saveModle .top .btn:hover, .saveAddress .top .btn:hover {
            color: red;
        }

        .saveModle .saveBtn {
            margin: 0 auto;
            margin-top: 35px;
            display: block;
        }

        .saveAddress .saveBtn {
            margin: 0 auto;
            display: block;
        }

        .addressTitle {
            float: left;
            width: 80px;
            box-shadow: 0 0 black;
            line-height: 30px;
        }

        input.addressValue {
            float: left;
            width: 275px;
            border: 1px solid #ddd;
            height: 30px;
        }

        .modleBj {
            position: fixed;
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            z-index: 1977;
            background: #DCE2F1;
            filter: alpha(opacity=60);
            opacity: .6;
            display: none;
        }

        #modal {
            height: 100%;
            width: 100%;
            position: absolute;
            z-index: 999;
            background-color: white;
        }

        .td-value {
            text-align: left !important;
            vertical-align: middle;
            word-wrap: break-word;
            color: #2a8cec !important;
        }

        .td-value span {
            display: inline-block;
            max-height: 56px;
            overflow: hidden;
            padding: 0 6px;
            word-wrap: break-word;
        }

        .td-value1 {
            text-align: center !important;
            vertical-align: middle;
            word-wrap: break-word;
            color: #2a8cec !important;
        }

        .td-value1 input {
            text-align: center;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        label {

            display: block;
            text-align: left;
            margin-left: 10px;
            margin-bottom: 0px;
        }

        label input {
            margin-left: 0px;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .table-bordered tbody tr:last-child td {
            border-bottom-color: transparent !important;
        }

        .lastTable tbody tr:last-child td {
            border-bottom-color: #cbcbcd !important;
        }

        .tableTomorrow input, .tableTomorrow select {
            background: #f5f5f5;
        }

        .tableTomorrow input, .tableTomorrow td {
            background: #f5f5f5;
        }

        .divSelect {
            width: 100px;
            border: 1px solid #DEDEDE;
            margin-left: 10px;
            float: left;
        }

        #entourage input:hover {
            background-color: #e6f2fa;
        }

        .table-no-border-left {
            border-left-width: 0px !important;
        }

        .table-width-auto {
            width: 33.5% !important;
        }

        .table-bottom-width {
            border-bottom-width: 0px !important;
        }

        .shen a {
            display: inline-block;
            width: 30%;
            outline: 0;
            padding: 0;
            text-align: center;
            white-space: nowrap;
            text-decoration: none;
            color: #333;
            cursor: pointer;
        }

        .evaluation {
            cursor: pointer;
            width: 36px;
            margin: 0 auto;
            height: 18px;
            line-height: 18px;
            text-align: justify;
            display: inline-block;
            overflow: hidden;
            vertical-align: middle;
        }

        .pingjia {
            border: 1px solid rgb(188, 184, 184);
            width: 120px;
            height: 20px;
            line-height: 19px;
            color: rgb(188, 184, 184);
            float: left;
            margin-left: 20px;
            text-align: center;
            margin-top: 5px;
            vertical-align: top;
            cursor: pointer;
        }

        .pingjia_active {
            border: 1px solid #2a8cec;
            width: 120px;
            height: 20px;
            line-height: 19px;
            background: #2a8cec;
            color: #FFffff;
            float: left;
            margin-left: 20px;
            text-align: center;
            margin-top: 5px;
            vertical-align: top;
            cursor: pointer;
        }

        .fixed-table_body tr td {
            /*border-right: none;*/
            font-size: 12px;
            text-align: center;
        }

        .fixed-table_header tr th {
            /*border-right: none;*/
            background: yellow;
            font-weight: normal;
            font-size: 12px;
        }

        .fixedDiv {
            height: 40px;
            line-height: 40px;
            position: fixed;
            width: 100%;
            background: white;
            top: 0px;
            padding-top: 13px;
            z-index: 999;
        }

        /*.fixed-table-box {*/
        /*position: relative;*/
        /*font-size: 12px;*/
        /*line-height: 1.42858;*/
        /*border-width: 1px 0px 0px 1px;*/
        /*border-style: solid solid;*/
        /*border-color: #CDCDCD;*/
        /*border-image: initial;*/
        /*border-bottom-width: 1px;*/
        /*border-right-width: 1px;*/
        /*overflow: hidden;*/
        /*}*/
        .icon_radio {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: solid 1px #aaaaaa;
            background-color: #ffffff;
            cursor: pointer;
            position: absolute;
            top: 0px;
            left: 28px;
        }

        .icon_active_radio {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            cursor: pointer;
            border: solid 1px #aaaaaa;
            /*background-color: #0076FF;*/
            background: url("/dist/img/duigouw.png") -2px center no-repeat;

            position: absolute;
            top: 0px;
            left: 28px;
        }

        .fixed-table-box th {
            position: relative;
            text-align: left;
            height: 25px;
            border-width: 1px;
            border-style: solid;
            border-color: rgb(203, 203, 205);
            border-image: initial;
        }

        .fixed-table-box td {
            position: relative;
            text-align: left;
            padding: 0 2px;
            height: 25px;
            border: 1px solid #cbcbcd;
        }

        .fixed-table_header tr th {
            background: #fff !important;
            color: black !important;
        }

        .fixed-table_header tr td {
            background: #fff !important;
            color: black !important;
        }
    </style>
    <script src="/dist/js/pages/wreport/service.js?t=42e28def"></script>
    <script src="/dist/js/pages/wreport/Template.js?t=42e28def"></script>

</head>
<body style="background-color:#fff; position: relative">
<div class="div-td-content-more"><i></i></div>
<div class="oaLoad">
    <div class="loadGif" id="areaProgress"></div>
</div>
<div class="clearfix"></div>
<!--<div id="modal"></div>-->
<section class="content" id="app" v-cloak>
    <div class="fixedDiv">
        <div class="divOne" style="width:600px;margin: 0 auto;">
            <h3 class="text-center" style="margin-top:0px;">{{report.main.title}}</h3>
        </div>
    </div>
    <div class="model-picker-dropdown">
        <div class="model-select-wrap">
            <div class="model-select-tab">
                <a class="active" data-count="type">省</a><a class="" data-count="brand">市</a><a data-count="model"
                                                                                                class="">县</a>
            </div>
            <div class="model-select-content">
                <div class="model-select type shen" data-count="type" style="display: block;">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="(item,i) in provinceList">{{item.name}}</a>
                    </dl>
                </div>
                <div class="model-select brand" data-count="province">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="(item,i) in cityList">{{item.name}}</a>
                    </dl>
                </div>
                <div class="model-select model" data-count="model">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="(item,i) in countyList">{{item.name}}</a>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <div class="td-value1"
         style="padding: 10px;width: 215px;height: 92px; margin-left: 0px;display: none;position: absolute;z-index:999; border: 1px solid #DEDEDE; !important;margin-left: 0px;background-color: white"
         id="selectModel">
        <select id="testType" class="divSelect" v-model="selectType" @change="getBran">
            <option value="设备类型">设备类型</option>
            <option v-for="itemT in itemsType" v-bind:value="itemT.id">{{itemT.name}}</option>
        </select>
        <select id="testBran" class="divSelect" v-model="selectBran" @change="getMod">
            <option value="品牌">品牌</option>
            <option v-for="itemB in itemsBran" v-bind:value="itemB.id">{{itemB.brandName}}</option>
        </select>
        <select id="testMod" class="divSelect" v-model="selectMod">
            <option value="型号">型号</option>
            <option v-for="itemMo in itemsMod">{{itemMo.modelName}}</option>
        </select>
        <input type="button" value="确定" style="margin-left: 12px" class="btn oaBtn btn-xs"
               @click="getIntentionModel(divInModel)">
        <input type="button" value="取消" class="btn oaBtn btn-xs" style="margin-left: 12px;margin-top: 25px; "
               @click="hiddenDivModel()">
    </div>

    <div class="td-value1"
         style="width: 114px;height: auto; margin-left: 0px;display: none;position: absolute;z-index:999; border: 1px solid #cbcbcd; !important;margin-left: 0px;background-color: white"
         id="entourage">
        <input v-for="(item,i) in entourage" type="text"
               style="margin:0;text-align: left;width: 100%;cursor: pointer;line-height: 24px;color:#2a8cec;"
               v-model="item.name" @click="addEntourage(item.name,divInEntourage)">
    </div>

    <div v-if="currentUserTel == '15034156981'"
         style="width:300px;height:30px;position:absolute;right:10px;top:0px;z-index: 9999">
        <input type="button" v-for="item in templates" :value="item.name"
               @click="getModulesByTemplateId(item.id)"/>
    </div>
    <div style="height: 40px;line-height: 40px;width: 100%;">
    </div>
    <table class="table  table-bordered text-center" v-if="pingjiaFlag=='true'"
           style="border-left: none;border-right: none; width: 50%;float: right">
        <tr style="height: 26px">
            <td class="td-title" style="border-left: none;">
                <span>{{commentTitle}}</span>
            </td>
            <td class="td-title" style="width:60px;">
                <span>是否合格</span>
            </td>
            <td class="td-title" style="width:60px;">
                <span>评价人</span>
            </td>
        </tr>
        <tr style="height: 25px" v-for="item in commentList">
            <td class="td-value" style="border-left: none;">
                <span class="lineOne">{{item.otherDescription}}</span>
            </td>
            <td class="td-value" v-if="item.grade=='未评价'" style="width:60px;text-align: center !important;">
                {{item.grade}}
            </td>
            <td v-else class="td-value" style="width:60px;text-align: center !important;">
                {{item.grade=='合格'?'是':'否'}}
            </td>
            <td class="td-value" style="width:60px;text-align: center !important;">{{item.createUserName}}</td>
        </tr>
        <tr style="height: 25px" v-for="item in abs(pingjiaNum)" v-if="pingjiaNum>0">
            <td style="border-left: none;"><input type="text" readonly/></td>
            <td style="width:60px;"><input type="text" readonly/></td>
            <td style="width:60px;"><input type="text" readonly/></td>
        </tr>
    </table>
    <table class="table  table-bordered text-center" style="width: 50%">
        <tr>
            <!--<td v-if="isHasModule('tomorrowAMPlan')" class="td-title width90">次日上午安排</td>-->
            <!--<td v-if="isHasModule('tomorrowAMPlan')" class="td-value" style="width:40%;">-->
            <!--<input v-if="pageType=='edit'" type="text" style="padding-right: 1000px"-->
            <!--v-model="report.tomorrowAMPlan.content"/>-->
            <!--<span v-else>{{report.tomorrowAMPlan.content}}</span>-->
            <!--</td>-->
            <td v-if="isHasModule('experience')" class="td-title width90" rowspan="2">心得体会</td>
            <td v-if="isHasModule('experience')" class="td-value" rowspan="2">
                <input v-if="pageType=='edit'" type="text" v-model="report.experience.content"
                       style="text-align: left !important;"/>
                <span v-else class="lineOne">{{report.experience.content}}</span>
            </td>
        </tr>
        <!--<tr v-if="isHasModule('tomorrowPMPlan')">-->
        <!--<td class="td-title width90">次日下午安排</td>-->
        <!--<td class="td-value">-->
        <!--<input v-if="pageType=='edit'" type="text" v-model="report.tomorrowPMPlan.content"/>-->
        <!--<span v-else>{{report.tomorrowPMPlan.content}}</span>-->
        <!--</td>-->
        <!--</tr>-->
    </table>
    <table class="table  table-bordered text-center" style="width: 50%">
        <tr v-if="isHasModule('personSituation')">
            <td class="td-title width90">人员情况</td>
            <td class="td-value">
                <input v-if="pageType=='edit'" type="text"
                       v-model="report.personSituation.content" style="text-align: left !important;"/>
                <span v-else>{{report.personSituation.content}}</span>
            </td>
        </tr>
        <tr v-if="isHasModule('tomorrowPlan')">
            <td class="td-title width90">第二天计划</td>
            <td class="td-value">
                <input v-if="pageType=='edit'" type="text" v-model="report.tomorrowPlan.content"
                       style="text-align: left !important;"/>
                <span v-else class="lineOne">{{report.tomorrowPlan.content}}</span>
            </td>
        </tr>
        <tr v-if="isHasModule('troubleShooting')" v-for="(item,i) in report.troubleShooting">
            <td rowspan="3" style="line-height:24px; border-bottom-color: transparent !important;"
                class="td-title width90" v-if="i==0">当天未处理的前三个疑难故障
            </td>
            <td class="td-value">
                <input v-if="pageType=='edit'" type="text" v-model="item.trackContent"/>
                <span v-else>{{item.trackContent}}</span>
            </td>
        </tr>
    </table>
    <table class="table  table-bordered text-center" style="width: 50%">
        <tr v-if="isHasModule('forSupportMatters')" v-for="(matter,i) in report.forSupportMatters">
            <td :rowspan="2+leftNum" style="line-height:24px; border-bottom-color: transparent !important;"
                class="td-title width90" v-if="i==0">需要公司支持的事项
            </td>
            <td class="td-value" style="height: 25px">
                <input v-if="pageType=='edit'" type="text" v-model="matter.trackContent"
                       style="text-align: left !important;">
                <span v-else class="lineOne">{{matter.trackContent}}</span>
            </td>
            <!--<td class="td-value" v-for="item in leftNum" v-if="leftNum>0">-->
            <!--<input type="text"  readonly-->
            <!--style="text-align: left !important;">-->
            <!--</td>-->
        </tr>
        <tr v-for="item in leftNum" v-if="leftNum>0">
            <td class="td-value">
                <input type="text" readonly/>
            </td>
        </tr>
    </table>
    <!--第二天面访计划 （大客户经理）-->
    <table class="table  table-bordered text-center" v-if="isHasModule('tomorrowVisitPlan')">
        <tr>
            <td colspan="7" class="td-module">第二天拜访计划
                <span class="span-a-btn" v-if="pageType=='edit'">
                <a href="javascript:void(0);" class="a-btn"
                   @click="addRow('tomorrowVisitPlan','TomorrowVisitPlan')">添加一行</a>
                <a href="javascript:void(0);" class="a-btn"
                   @click="delRow('tomorrowVisitPlan')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr>
            <th class="width90">客户名称</th>
            <th style="width: 98px;">上次拜访时间</th>
            <th style="width: 98px;">客户地点</th>
            <th style="width: 98px;">客户行业</th>
            <th style="width: 98px;">意向设备</th>
            <th>备注</th>
        </tr>
        <tr v-for="(item,i) in report.tomorrowVisitPlan">
            <td class="td-value1">
                <input type="text" v-if="pageType=='edit'" v-model="item.customerName" v-line-inserted="i"
                       class="txtParent" @click="onfocus1(i)">
                <span v-else style="text-align: center !important;">{{item.customerName}}</span>
            </td>
            <td class="td-value1">
                <input type="text" v-if="pageType=='edit'" v-model="item.lastVisitTime"
                       @focus="showDatePicker($event,item)">
                <span v-else>{{item.lastVisitTime}}</span></td>
            <td class="td-value1">
                <input type="text" v-if="pageType=='edit'" v-model="item.customerAddress">
                <span v-else>{{item.customerAddress}}</span></td>
            <td class="td-value1">
                <input type="text" v-if="pageType=='edit'" v-model="item.customerIndustry">
                <span v-else>{{item.customerIndustry}}</span></td>
            <td class="td-value1">
                <input type="text" v-if="pageType=='edit'" v-model="item.intentionDevice">
                <span v-else>{{item.intentionDevice}}</span></td>
            <td class="td-value">
                <input type="text" v-if="pageType=='edit'" v-model="item.remake">
                <span v-else class="lineOne">{{item.remake}}</span></td>
        </tr>
    </table>
    <!--第二天面访计划 （区域经理）头部-->
    <table class="table  table-bordered text-center table-bottom-width" v-if="isHasModule('tomorrowVisitPlanRegion')">
        <tr>
            <td colspan="9" class="td-module">第二天面访计划
                <!--<span style="color: red" v-if="roleName!='大客户经理'">(请至少填写3条计划)</span>-->
                <!--<span class="span-a-btn" v-if="pageType=='edit'">-->
                <!--<a href="javascript:void(0);" class="a-btn"-->
                <!--@click="addRow('tomorrowVisitPlan2','TomorrowVisitPlan')">添加一行</a>-->
                <!--<a href="javascript:void(0);" class="a-btn"-->
                <!--@click="delRow('tomorrowVisitPlan2')">删除一行</a>-->
                <!--</span>-->
            </td>
        </tr>
    </table>
   <!--第二天面访计划 （区域经理）  上午计划和 下午计划 头部-->
    <table class="table  table-bordered text-center table-bottom-width"
           v-if="isHasModule('tomorrowAMPlan')&&isHasModule('tomorrowPMPlan')&&!isHasModule('tomorrowVisitPlanRegion')">
        <tr>
            <td colspan="9" class="td-module">第二天面访计划
            </td>
        </tr>
    </table>
    <!--上午计划描述、下午计划描述-->
    <table class="table  table-bordered text-center" v-if="isHasModule('tomorrowAMPlan')&&isHasModule('tomorrowPMPlan')&&!isHasModule('tomorrowVisitPlanRegion')">
        <tbody>
        <tr>
            <td class="td-title width90 td-row2">上午计划描述</td>
            <td class="td-value">
                    <textarea v-if="pageType=='edit'"
                              v-model="report.tomorrowAMPlan.content"></textarea>
                <span v-else>{{report.tomorrowAMPlan.content}}</span>
            </td>
        </tr>
        <tr>
            <td class="td-title width90 td-row2">下午计划描述</td>
            <td class="td-value">
                <textarea v-if="pageType=='edit'" v-model="report.tomorrowPMPlan.content"></textarea>
                <span v-else>{{report.tomorrowPMPlan.content}}</span>
            </td>
        </tr>
        </tbody>
    </table>
    <!--旧的区域经理第二天面访计划-->
    <table v-if="isHasModule('tomorrowVisitPlanRegion')" class="table table-bordered text-center"
           style="width: 33.2%;float: left;">
        <tr>
            <th style="width: 96px;">拜访目的</th>
            <th style="width: 77px;">客户姓名</th>
            <th style="width: 77px;">陪同人员</th>
            <th style="width: 96px;">地点</th>
        </tr>
    </table>
    <table v-if="isHasModule('tomorrowVisitPlanRegion')" class="table table-bordered text-center"
           style="width: 33.2%;float: left;">
        <tr>
            <th style="width: 96px;background: #f5f5f5">拜访目的</th>
            <th style="width: 77px;background: #f5f5f5">客户姓名</th>
            <th style="width: 77px;background: #f5f5f5">陪同人员</th>
            <th style="width: 96px;background: #f5f5f5">地点</th>
        </tr>
    </table>
    <table v-if="isHasModule('tomorrowVisitPlanRegion')" class="table table-bordered text-center"
           style="width: 33.5%;float: left;">
        <tr>
            <th style="width: 96px;">拜访目的</th>
            <th style="width: 77px;">客户姓名</th>
            <th style="width: 77px;">陪同人员</th>
            <th style="width: 96px;">地点</th>
        </tr>
    </table>
    <table v-for="(item,i) in report.tomorrowVisitPlan"
           style="width: 33.2% ;float: left;border-top-width: 0px !important;"
           v-if="isHasModule('tomorrowVisitPlanRegion')" class="table table-bordered text-center"
           :class="{'table-no-border-left' : (i%3!=0),'tableTomorrow':(i%3==1),'table-width-auto':(i%3==2)}">
        <tr>
            <td class="td-value1" style="width:96px;">
                <select v-if="pageType=='edit'" v-model="item.visitGoal">
                    <option value="首次拜访">
                        首次拜访
                    </option>
                    <option value="重复拜访">
                        重复拜访
                    </option>
                    <option value="意向跟踪">
                        意向跟踪
                    </option>
                    <option value="扫村扫街">
                        扫村扫街
                    </option>
                </select>
                <span v-else>{{item.visitGoal}}</span>
            </td>
            <td class="td-value" style="width:77px;">
                <input type="text" v-if="pageType=='edit'" v-model="item.customerName" v-line-inserted="i"
                       class="txtParent" @click="onfocus1(i)" style="text-align: center !important;">
                <span v-else class="lineOne" style="text-align: center !important;">{{item.customerName}}</span>

            </td>
            <td class="td-value" style="width:77px;">
                <input type="text" v-if="pageType=='edit'" :id="'entourage'+i" class="visitGoalShow"
                       v-model="item.entourage" @click="onfocus1(i),getEntourage($event,i,'tomorrowVisitPlanRegion')"
                       readonly style="text-align: center !important;">
                <span v-else class="lineOne" style="text-align: center !important;">{{item.entourage}}</span>
            </td>
            <td class="td-value" style="width: 96px;">
                <template v-if="pageType=='edit'">
                    <input @click="openAddress(i)" :value="item.customerAddress" type="text" readonly
                           style="text-align: left"/>
                    <!--<input type="text" readonly placeholder="请选择县" v-model="item.county" @click="onfocus1(i)" class="selectModel" style="width: 61px;position: absolute;padding: 0px;height: 24px;line-height: 24px;border-right: 1px solid #ddd;text-align: center;">-->
                    <!--<input type="text"  v-model="item.customerAddress" style="padding-left:61px;text-align: left;">-->
                </template>
                <span v-else class="lineOne">{{item.customerAddress}}</span>
            </td>
        </tr>
    </table>
    <!--第二天面访计划 （大区经理）-->
    <table class="table  table-bordered text-center table-bottom-width"
           v-if="isHasModule('tomorrowVisitPlanBigRegion')">
        <tr>
            <td colspan="12" class="td-module">第二天面访计划<span style="color: red;"
                                                            v-if="roleName!='销售总监'&&roleName!='大客户总监'">(请至少填写1条计划)</span>
                <span class="span-a-btn" v-if="pageType=='edit'">
                <a href="javascript:void(0);" class="a-btn"
                   @click="addRow('tomorrowVisitPlan2','TomorrowVisitPlan')">添加一行</a>
                <a href="javascript:void(0);" class="a-btn"
                   @click="delRow('tomorrowVisitPlan2')">删除一行</a>
                </span>
            </td>
        </tr>
    </table>
    <table v-if="isHasModule('tomorrowVisitPlanBigRegion')" class="table table-bordered text-center"
           style="width: 33.2%;float: left;">
        <tr>
            <th style="width: 96px;">拜访目的</th>
            <th style="width: 77px;">客户名称</th>
            <th style="width: 77px;">陪同人员</th>
            <th>地点</th>
        </tr>
    </table>
    <table v-if="isHasModule('tomorrowVisitPlanBigRegion')" class="table table-bordered text-center"
           style="width: 33.2%;float: left;">
        <tr>
            <th style="width: 96px;background: #f5f5f5">拜访目的</th>
            <th style="width: 77px;background: #f5f5f5">客户名称</th>
            <th style="width: 77px;background: #f5f5f5">陪同人员</th>
            <th style="background: #f5f5f5">地点</th>
        </tr>
    </table>
    <table v-if="isHasModule('tomorrowVisitPlanBigRegion')" class="table table-bordered text-center"
           style="width: 33.5%;float: left;">
        <tr>
            <th style="width: 96px;">拜访目的</th>
            <th style="width: 77px;">客户名称</th>
            <th style="width: 77px;">陪同人员</th>
            <th>地点</th>
        </tr>
    </table>
    <table v-for="(item,i) in report.tomorrowVisitPlan"
           style="width: 33.2% ;float: left;border-top-width: 0px !important;"
           v-if="isHasModule('tomorrowVisitPlanBigRegion')" class="table table-bordered text-center"
           :class="{'table-no-border-left' : (i%3!=0),'tableTomorrow':(i%3==1),'table-width-auto':(i%3==2)}">
        <tr>
            <td class="td-value1" style="width:96px;">
                <select v-if="pageType=='edit'" v-model="item.visitGoal" :id="'visitGoal'+i" @change="clearData(i)">
                    <option v-for="option in visitBigGoalList" v-bind:value="option.value">
                        {{option.text}}
                    </option>
                </select>
                <span v-else>{{item.visitGoal}}</span>
            </td>
            <td class="td-value" style="width:77px;">

                <!--<input type="text" v-if="pageType=='edit'&&item.visitGoal!='陪同跑动'" v-model="item.customerName"-->
                <!--v-line-inserted="i"-->
                <!--class="txtParent" @click="onfocus1(i),getEntourage($event,i)">-->
                <!--<input type="text" v-else-if="pageType=='edit'" :id="'entourage'+i" class="visitGoalShow"-->
                <!--v-model="item.customerName" @click="onfocus1(i),getEntourage($event,i)" readonly>-->
                <!--<span v-else class="lineOne">{{item.customerName}}</span>-->
                <input type="text" v-if="pageType=='edit'" v-model="item.customerName"
                       style="text-align: center !important;">
                <span v-else class="lineOne" style="text-align: center !important;">{{item.customerName}}</span>
            </td>
            <td class="td-value" style="width:77px;">
                <input type="text" v-if="pageType=='edit'" :id="'entourage'+i" class="visitGoalShow"
                       v-model="item.entourage"
                       @click="onfocus1(i),getEntourage($event,i,'tomorrowVisitPlanBigRegion')"
                       readonly style="text-align: center !important;">
                <span v-else class="lineOne" style="text-align: center !important;">{{item.entourage}}</span>
            </td>
            <td class="td-value">
                <template v-if="pageType=='edit'">
                    <!--<input type="text" readonly placeholder="请选择县" v-model="item.county" @click="onfocus1(i)" class="selectModel" style="width: 61px;position: absolute;padding: 0px;height: 24px;line-height: 24px;border-right: 1px solid #ddd;text-align: center;">-->
                    <!--<input type="text"  v-model="item.customerAddress" style="padding-left:61px;text-align: left;">-->
                    <input @click="openAddress(i)" :value="item.customerAddress" type="text" readonly
                           style="text-align: left"/>
                </template>
                <span v-else class="lineOne">{{item.customerAddress}}</span>
            </td>

        </tr>
    </table>
    <!--暂时不用 当日拜访情况_区域经理（面访）-->
    <table class="table  table-bordered text-center" v-if="isHasModule('todayCustomerVisit')">
        <tr>
            <td colspan="9" class="td-module">当日面访情况
                <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayCustomerVisit','CustomerSaler')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('todayCustomerVisit')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr class="td-title">
            <td style="width: 95px;">客户电话</td>
            <td style="width: 77px;">客户来源</td>
            <td style="width: 70px;">姓名</td>
            <td style="width: 155px;" v-if="report.main.title.indexOf('大客户')!=-1">客户公司</td>

            <!--<td style="width: 60px;">客户生日</td>-->
            <!--<td  style="width: 48px;">拜访方式</td>-->
            <td style="width: 70px;">陪同人员</td>
            <td>资金情况、来源(首付款金额)、已有设备(设备类型)、股东构成、行业经验、信誉、工程情况、竞争对手情况</td>
            <td style="width: 70px;">意向机型</td>
            <td style="width: 70px;">购买方式</td>
            <td style="width: 70px;">购买时间</td>


        </tr>
        <tr v-for="(item,i) in report.todayCustomerVisit">
            <td class="td-row2 width90 td-value1">
                <input v-if="pageType=='edit'" @blur="findCusByTel(item)" type="text" v-model="item.tel"/>
                <span v-else>{{item.tel}}</span>
            </td>
            <!--<td class="td-row2"><input type="text" v-model="item.source"/></td>-->
            <td class="td-row2 width60 td-value1">
                <select v-if="pageType=='edit'" v-model="item.source">
                    <option v-for="option in cusSource" v-bind:value="option.value">
                        {{option.text}}
                    </option>
                </select>
                <span v-else>{{item.source}}</span>
            </td>

            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.name"/>
                <span v-else>{{item.name}}</span>
            </td>
            <td class="td-row2 width60 td-value1" v-if="report.main.title.indexOf('大客户')!=-1">
                <input v-if="pageType=='edit'" type="text" v-model="item.companyName"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.companyName}}</span>
            </td>
            <!--<td class="td-row2 width60 td-value1">-->
            <!--<input v-if="pageType=='edit'" type="text" v-model="item.birthDay"/>-->
            <!--<span v-else>{{item.birthDay}}</span>-->
            <!--</td>-->
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.entourage"/>
                <span v-else>{{item.entourage}}</span>
            </td>
            <td class="td-row3 td-value">
                   <textarea v-if="pageType=='edit'"
                             v-model="item.otherCondition"></textarea>
                <span v-else>{{item.otherCondition}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.intentionModel"/>
                <span v-else>{{item.intentionModel}}</span>
            </td>
            <td class="width60 td-value1">
                <select v-if="pageType=='edit'" v-model="item.buyType">
                    <option v-for="option in buyTypeList" v-bind:value="option.value">
                        {{ option.text }}
                    </option>
                </select>
                <span v-else>{{item.buyType}}</span>
            </td>
            <td class="width60 td-value1">
                <select v-if="pageType=='edit'" v-model="item.buyDate">
                    <option v-for="option in buyDateList" v-bind:value="option.value">
                        {{option.text}}
                    </option>
                </select>
                <span v-else>{{item.buyDate}}</span>
            </td>

        </tr>
    </table>
    <!--当日拜访客户(区域经理)-->
    <table class="table  table-bordered text-center" v-if="isHasModule('todayVisitCustomer')">
        <tr>
            <td colspan="12" class="td-module" style="position: relative">
                <span style="display: block;height: 20px;line-height: 20px;">今日面访/电访情况描述</span>
                <span style="color: red;display: block;height: 20px;line-height: 20px;">(请使用APP中面访和电访按钮记录今日的拜访情况，否则此处不能填写，此处只能填写面访电访内容，其它内容请在《今日其它事务描述》中填写)</span>
                <span class="span-a-btn" v-if="pageType=='edit'" style="top: 8px;right: -12px;">
                <a href="javascript:void(0);" class="a-btn"
                   @click="addRow('todayVisitCustomer','CustomerSalerVisit')">添加电访客户</a>
                <a href="javascript:void(0);" class="a-btn"
                   @click="delRow('todayVisitCustomer')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr class="td-title">
            <td style="width: 95px;">客户电话</td>
            <td style="width: 70px;">姓名</td>
            <td style="width: 77px;">客户来源</td>
            <td style="width: 84px;">客户类型</td>
            <!--<td style="width: 65px;">信用等级</td>-->

            <td style="width: 95px;" v-if="report.main.title.indexOf('大客户')!=-1">客户公司</td>
            <!--<td style="width: 60px;">客户生日</td>-->
            <td style="width: 30px;">拜访<br>方式</td>
            <td style="width: 60px;">陪同人员</td>

            <td><span style="margin-right: 280px">资金情况、来源(首付款金额)、已有设备(设备类型)、股东构成、行业经验、信誉、工程情况、竞争对手情况</span></td>
            <td style="width: 90px;">是否意向客户</td>
            <!--<td style="width: 70px;">购买方式</td>-->
            <!--<td style="width: 70px;">购买时间</td>-->
            <!--<td style="width: 60px;">成交概率</td>-->
        </tr>
        <tr v-for="(item,i) in report.todayVisitCustomer" style="position: relative !important;">
            <td class="td-row2 width90 td-value1">
                <input v-if="pageType=='edit'&&item.visitMode!=1" @blur="findCusByTel(item)" type="text"
                       v-model="item.tel"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.tel}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'&&item.visitMode!=1 " type="text" v-model="item.name"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.name}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <select v-if="pageType=='edit' &&item.visitMode!=1" v-model="item.source">
                    <option v-for="option in cusSource" v-bind:value="option.value">
                        {{option.text}}
                    </option>
                </select>
                <span v-else class="td-value" style="text-align: center !important;">{{item.source}}</span>
            </td>
            <!--<td class="td-row2"><input type="text" v-model="item.source"/></td>-->
            <td class="td-row2 width60 td-value1">
                <select v-if="pageType=='edit'&&item.visitMode!=1" v-model="item.customerType">
                    <option v-for="option in customerType">
                        {{option.customerType}}
                    </option>
                </select>
                <span v-else class="td-value" style="text-align: center !important;">{{item.customerType}}</span>
            </td>
            <!--<td class="td-row2 width60 td-value1">-->
            <!--<select v-if="pageType=='edit'" v-model="item.customerCredit">-->
            <!--<option v-for="option in customerCredit" v-bind:value="option.value">-->
            <!--{{option.text}}-->
            <!--</option>-->
            <!--</select>-->
            <!--<span v-else class="td-value" style="text-align: center !important;">{{item.customerCredit}}</span>-->
            <!--</td>-->


            <td class="td-row2 width60 td-value1" v-if="report.main.title.indexOf('大客户')!=-1">
                <input v-if="pageType=='edit'" type="text" v-model="item.companyName"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.companyName}}</span>
            </td>
            <!--<td class="td-row2 width60 td-value1">-->
            <!--<input v-if="pageType=='edit'" type="text" v-model="item.birthDay"/>-->
            <!--<span v-else>{{item.birthDay}}</span>-->
            <!--</td>-->
            <td class="td-value1">

                <span v-if="pageType=='edit'">{{item.visitMode}}</span>

                <template v-else>
                    <span v-if="item.tel==''"></span>
                    <span v-else>{{item.visitMode}}</span>
                </template>


            </td>
            <td class="td-row2 width60 td-value1">
                <span class="td-value" style="text-align: center !important;">{{item.entourage}}</span>
            </td>
            <td class="td-row3 td-value">
                   <textarea v-if="pageType=='edit'"
                             v-model="item.otherCondition"></textarea>
                <span v-else>{{item.otherCondition}}</span>
            </td>

            <td class="td-row2 width60 td-value1">
                            <span v-if="pageType=='edit'" style="display: flex;align-items: center;">

                                  <label style="margin-left: 0" style="width: 25%;" @change="goIntent(i,item)">
                                       <input style="margin-left: 15px;float: left" class="tdInput"
                                              type="radio"
                                              value="1" v-model="item.intentionFlag">
                                      <span style="float: left;height: 20px;line-height: 20px">是</span>
                                  </label>

                                  <label style="margin-left: 0">
                                      <input class="tdInput" style="margin-left: 15px;float: left"
                                             type="radio"
                                             value="0" v-model="item.intentionFlag"><span
                                          style="float: left;height: 20px;line-height: 20px">否</span></label>
                              </span>
                <!--<input v-if="pageType=='edit'" type="hidden" v-model="item.intentionDevice"/>-->
                <!--<input v-if="pageType=='edit'" type="hidden" v-model="item.intentionBrand"/>-->
                <!--<span v-if="pageType=='edit'" style="height : 45px;padding-top: 12px;"-->
                <!--@click="onfocus1(i),showDivModel($event,'todayVisitCustomer')">{{item.intentionModel}}</span>-->
                <!--<span v-else class="td-value">{{item.intentionModel}}</span>-->
                <template v-else>
                    <span v-if="item.tel==''"></span>
                    <span v-else class="td-value"
                          style="text-align: center !important;">{{item.intentionFlag=='1'?'是':'否'}}</span>
                </template>
                <!--<input v-if="pageType=='edit'" type="text" v-model="item.intentionModel"/>-->
                <!--<span v-else class="td-value" style="text-align: center !important;">{{item.intentionModel}}</span>-->
            </td>
            <!--<td class="width60 td-value1">-->
            <!--&lt;!&ndash;<select v-if="pageType=='edit'" v-model="item.buyType">&ndash;&gt;-->
            <!--&lt;!&ndash;<option v-for="option in buyTypeList" v-bind:value="option.value">&ndash;&gt;-->
            <!--&lt;!&ndash;{{ option.text }}&ndash;&gt;-->
            <!--&lt;!&ndash;</option>&ndash;&gt;-->
            <!--&lt;!&ndash;</select>&ndash;&gt;-->
            <!--<span>{{item.buyType}}</span>-->
            <!--</td>-->
            <!--<td class="width60 td-value1">-->
            <!--&lt;!&ndash;<select v-if="pageType=='edit'" v-model="item.buyDate">&ndash;&gt;-->
            <!--&lt;!&ndash;<option v-for="option in buyDateList" v-bind:value="option.value">&ndash;&gt;-->
            <!--&lt;!&ndash;{{option.text}}&ndash;&gt;-->
            <!--&lt;!&ndash;</option>&ndash;&gt;-->
            <!--&lt;!&ndash;</select>&ndash;&gt;-->
            <!--<span>{{item.buyDate}}</span>-->
            <!--</td>-->
            <!--<td class="width60 td-value1">-->
            <!--&lt;!&ndash;<select v-if="pageType=='edit'" v-model="item.chance">&ndash;&gt;-->
            <!--&lt;!&ndash;<option v-for="option in chanceList" v-bind:value="option.value">&ndash;&gt;-->
            <!--&lt;!&ndash;{{option.text}}&ndash;&gt;-->
            <!--&lt;!&ndash;</option>&ndash;&gt;-->
            <!--&lt;!&ndash;</select>&ndash;&gt;-->
            <!--<span>{{item.chance}}</span>-->
            <!--</td>-->

        </tr>

    </table>
    <table class="table  table-bordered text-center" v-if="isHasModule('todayVisitCustomerService')">
        <tr>
            <td colspan="15" class="td-module">当日拜访客户跟踪
                <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayVisitCustomer','CustomerSalerVisit')">添加拜访客户</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('todayVisitCustomer')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr class="td-title">
            <td style="width: 60px;">客户类型</td>
            <td style="width: 60px;">客户电话</td>
            <td style="width: 60px;">客户姓名</td>
            <td style="width: 60px;">陪同人员</td>
            <td style="width: 71px;">服务类型</td>
            <td style="width: 60px;">机型</td>
            <td style="width: 75px;">序列号</td>
            <td>服务内容</td>
            <td style="width: 50px;">配件收费金额(元)</td>
            <td style="width: 50px;">工时收费金额(元)</td>
            <!--<td style="width: 75px;">设备信息</td>-->
            <td style="width: 50px;">设备小时数</td>
            <td style="width: 50px;">发动机编号</td>
            <td style="width: 60px;">收费情况</td>
        </tr>
        <tr v-for="(item,i) in report.todayVisitCustomer" style="position: relative !important;">
            <td class="td-row2 width60 td-value1">
                <select v-model="item.serverCustomerType" v-if="pageType=='edit'">
                    <option v-for="(item,i) in serverCustomerType" v-bind:value="item.value">
                        {{item.value}}
                    </option>
                </select>
                <span v-else class="td-value"
                      style="text-align: center !important;">{{item.serverCustomerType}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" @blur="findCusByTel(item)" type="text" v-model="item.tel"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.tel}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.name"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.name}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <span class="td-value" style="text-align: center !important;">{{item.entourage}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <select v-if="pageType=='edit'" v-model="item.otherVisitType">
                    <option v-for="option in serverVisitType">
                        {{option.value}}
                    </option>
                </select>
                <span v-else class="td-value" style="text-align: center !important;">{{item.otherVisitType}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <!--<input v-if="pageType=='edit'" type="hidden" v-model="item.intentionDevice"/>-->
                <!--<input v-if="pageType=='edit'" type="hidden" v-model="item.intentionBrand"/>-->
                <!--<span v-if="pageType=='edit'" style="height :45px;padding-top: 12px"-->
                <!--@click="onfocus1(i),showDivModel($event,'todayVisitCustomer')">{{item.intentionModel}}</span>-->
                <!--<span v-else class="td-value" style="text-align: center !important;">{{item.intentionModel}}</span>-->
                <input v-if="pageType=='edit'" type="text" v-model="item.intentionModel"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.intentionModel}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.serialNo"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.serialNo}}</span>
            </td>
            <td class="td-row3 td-value">
                   <textarea v-if="pageType=='edit'"
                             v-model="item.serverCondition"></textarea>
                <span v-else>{{item.serverCondition}}</span>
            </td>
            <td class="td-row2 width60 td-value1" style="position: relative">
                <template v-if="pageType=='edit'">
                    <input type="text" v-model="item.accessoriesChargesCondition"/>
                    <!--<span style="position: absolute;top: 24px;right: 6px">元</span>-->
                </template>
                <span v-else>{{item.accessoriesChargesCondition}}</span>
            </td>
            <td class="td-row2 width60 td-value1" style="position: relative">
                <template v-if="pageType=='edit'">
                    <input type="text" v-model="item.hoursChargesCondition"/>
                    <!--<span style="position: absolute;top: 24px;right: 6px">元</span>-->
                </template>
                <span v-else>{{item.hoursChargesCondition}}</span>
            </td>
            <!--<td class="td-row2 width60 td-value1">-->
            <!--<input v-if="pageType=='edit'" type="text" v-model="item.deviceInfo"/>-->
            <!--<span v-else class="td-value" style="text-align: center !important;">{{item.deviceInfo}}</span>-->
            <!--</td>-->
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.deviceHour"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.deviceHour}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.machineNo"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.machineNo}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <select v-if="pageType=='edit'" v-model="item.feeType">
                    <option v-for="option in feeType">
                        {{option.value}}
                    </option>
                </select>
                <span v-else class="td-value" style="text-align: center !important;">{{item.feeType}}</span>
            </td>
        </tr>
    </table>
    <table class="table  table-bordered text-center" v-if="isHasModule('todayVisitCustomerDebt')">
        <tr>
            <td colspan="12" class="td-module">当日拜访客户跟踪
                <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayVisitCustomer','CustomerSalerVisit')">添加拜访客户</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('todayVisitCustomer')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr class="td-title">
            <td style="width: 95px;">客户电话</td>
            <td style="width: 70px;">姓名</td>
            <td style="width: 70px;">陪同人员</td>
            <td style="width: 70px;">拜访类型</td>
            <td><span style="margin-right: 305px">情况描述</span></td>
        </tr>
        <tr v-for="(item,i) in report.todayVisitCustomer" style="position: relative !important;">
            <td class="td-row2 width90 td-value1">
                <input v-if="pageType=='edit'" @blur="findCusByTel(item)" type="text" v-model="item.tel"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.tel}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.name"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.name}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <span class="td-value" style="text-align: center !important;">{{item.entourage}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <select v-if="pageType=='edit'" v-model="item.otherVisitType">
                    <option v-for="option in debtVisitType">
                        {{option.value}}
                    </option>
                </select>
                <span v-else class="td-value" style="text-align: center !important;">{{item.otherVisitType}}</span>
            </td>
            <td class="td-row3 td-value">
                   <textarea v-if="pageType=='edit'"
                             v-model="item.debtCondition"></textarea>
                <span v-else>{{item.debtCondition}}</span>
            </td>

        </tr>

    </table>
    <table class="table  table-bordered text-center" v-if="isHasModule('todayVisitCustomerLetters')">
        <tr>
            <td colspan="12" class="td-module">当日拜访客户跟踪
                <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayVisitCustomer','CustomerSalerVisit')">添加拜访客户</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('todayVisitCustomer')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr class="td-title">
            <td style="width: 95px;">客户电话</td>
            <td style="width: 70px;">姓名</td>
            <td style="width: 70px;">陪同人员</td>
            <td style="width: 70px;">拜访类型</td>
            <td>
                <span style="margin-right: 305px">情况描述</span>
            </td>
        </tr>
        <tr v-for="(item,i) in report.todayVisitCustomer" style="position: relative !important;">
            <td class="td-row2 width90 td-value1">
                <input v-if="pageType=='edit'" @blur="findCusByTel(item)" type="text" v-model="item.tel"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.tel}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.name"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.name}}</span>
            </td>

            <td class="td-row2 width60 td-value1">
                <span class="td-value" style="text-align: center !important;">{{item.entourage}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <select v-if="pageType=='edit'" v-model="item.otherVisitType">
                    <option v-for="option in lettersVisitType">
                        {{option.value}}
                    </option>
                </select>
                <span v-else class="td-value" style="text-align: center !important;">{{item.otherVisitType}}</span>
            </td>
            <td class="td-row3 td-value">
                   <textarea v-if="pageType=='edit'"
                             v-model="item.lettersCondition"></textarea>
                <span v-else>{{item.lettersCondition}}</span>
            </td>
        </tr>

    </table>
    <!--<table class="table  table-bordered text-center" v-if="isHasModule('todayVisitCustomerBigRegion')">-->
    <!--<tr>-->
    <!--<td colspan="12" class="td-module">当日陪同下属拜访客户列表-->
    <!--&lt;!&ndash;<span class="span-a-btn" style="color: red">说明: 下属填写,自动抓取</span>&ndash;&gt;-->
    <!--</td>-->
    <!--</tr>-->
    <!--<tr class="td-title">-->
    <!--<td style="width: 95px;">客户电话</td>-->
    <!--<td style="width: 77px;">客户来源</td>-->
    <!--<td style="width: 84px;">客户类型</td>-->
    <!--<td style="width: 65px;">客户信用<br>等级</td>-->
    <!--<td style="width: 70px;">姓名</td>-->
    <!--<td style="width: 95px;" v-if="report.main.title.indexOf('大客户')!=-1">客户公司</td>-->
    <!--&lt;!&ndash;<td style="width: 60px;">客户生日</td>&ndash;&gt;-->
    <!--<td style="width: 30px;">拜访<br>方式</td>-->
    <!--<td style="width: 60px;">陪同人员</td>-->

    <!--<td>陪跑情况描述</td>-->
    <!--<td style="width: 60px;">意向机型</td>-->
    <!--<td style="width: 70px;">购买方式</td>-->
    <!--<td style="width: 70px;">购买时间</td>-->
    <!--<td style="width: 60px;">成交概率</td>-->
    <!--</tr>-->
    <!--<tr v-for="(item,i) in report.todayVisitCustomerBigRegion" style="position: relative !important;">-->
    <!--<td class="td-row2 width90 td-value1">-->
    <!--<input v-if="pageType=='edit'" @blur="findCusByTel(item)" type="text" v-model="item.tel"/>-->
    <!--<span v-else class="td-value" style="text-align: center !important;">{{item.tel}}</span>-->
    <!--</td>-->
    <!--<td class="td-row2 width60 td-value1">-->
    <!--<select v-if="pageType=='edit'" v-model="item.source">-->
    <!--<option v-for="option in cusSource" v-bind:value="option.value">-->
    <!--{{option.text}}-->
    <!--</option>-->
    <!--</select>-->
    <!--<span v-else class="td-value" style="text-align: center !important;">{{item.source}}</span>-->
    <!--</td>-->
    <!--&lt;!&ndash;<td class="td-row2"><input type="text" v-model="item.source"/></td>&ndash;&gt;-->
    <!--<td class="td-row2 width60 td-value1">-->
    <!--<select v-if="pageType=='edit'" v-model="item.customerType">-->
    <!--<option v-for="option in customerType">-->
    <!--{{option.customerType}}-->
    <!--</option>-->
    <!--</select>-->
    <!--<span v-else class="td-value" style="text-align: center !important;">{{item.customerType}}</span>-->
    <!--</td>-->
    <!--<td class="td-row2 width60 td-value1">-->
    <!--<select v-if="pageType=='edit'" v-model="item.customerCredit">-->
    <!--<option v-for="option in customerCredit" v-bind:value="option.value">-->
    <!--{{option.text}}-->
    <!--</option>-->
    <!--</select>-->
    <!--<span v-else class="td-value" style="text-align: center !important;">{{item.customerCredit}}</span>-->
    <!--</td>-->
    <!--<td class="td-row2 width60 td-value1">-->
    <!--<input v-if="pageType=='edit'" type="text" v-model="item.name"/>-->
    <!--<span v-else class="td-value" style="text-align: center !important;">{{item.name}}</span>-->
    <!--</td>-->

    <!--<td class="td-row2 width60 td-value1" v-if="report.main.title.indexOf('大客户')!=-1">-->
    <!--<input v-if="pageType=='edit'" type="text" v-model="item.companyName"/>-->
    <!--<span v-else class="td-value" style="text-align: center !important;">{{item.companyName}}</span>-->
    <!--</td>-->
    <!--&lt;!&ndash;<td class="td-row2 width60 td-value1">&ndash;&gt;-->
    <!--&lt;!&ndash;<input v-if="pageType=='edit'" type="text" v-model="item.birthDay"/>&ndash;&gt;-->
    <!--&lt;!&ndash;<span v-else>{{item.birthDay}}</span>&ndash;&gt;-->
    <!--&lt;!&ndash;</td>&ndash;&gt;-->
    <!--<td class="td-value1">-->

    <!--<span>{{item.visitMode}}</span>-->
    <!--</td>-->
    <!--<td class="td-row2 width60 td-value1">-->
    <!--<span class="td-value" style="text-align: center !important;">{{item.entourage}}</span>-->
    <!--</td>-->
    <!--<td class="td-row3 td-value">-->
    <!--<textarea v-if="pageType=='edit'"-->
    <!--v-model="item.otherCondition"></textarea>-->
    <!--<span v-else>{{item.otherCondition}}</span>-->
    <!--</td>-->

    <!--<td class="td-row2 width60 td-value1">-->

    <!--<input v-if="pageType=='edit'" type="hidden" v-model="item.intentionDevice"/>-->
    <!--<input v-if="pageType=='edit'" type="hidden" v-model="item.intentionBrand"/>-->
    <!--<span v-if="pageType=='edit'" style="height : 45px;padding-top: 12px;"-->
    <!--@click="onfocus1(i),showDivModel($event,'todayVisitCustomerBigRegion')">{{item.intentionModel}}</span>-->
    <!--<span v-else class="td-value">{{item.intentionModel}}</span>-->

    <!--</td>-->
    <!--<td class="width60 td-value1">-->
    <!--<select v-if="pageType=='edit'" v-model="item.buyType">-->
    <!--<option v-for="option in buyTypeList" v-bind:value="option.value">-->
    <!--{{ option.text }}-->
    <!--</option>-->
    <!--</select>-->
    <!--<span v-else>{{item.buyType}}</span>-->
    <!--</td>-->
    <!--<td class="width60 td-value1">-->
    <!--<select v-if="pageType=='edit'" v-model="item.buyDate">-->
    <!--<option v-for="option in buyDateList" v-bind:value="option.value">-->
    <!--{{option.text}}-->
    <!--</option>-->
    <!--</select>-->
    <!--<span v-else>{{item.buyDate}}</span>-->
    <!--</td>-->
    <!--<td class="width60 td-value1">-->
    <!--<select v-if="pageType=='edit'" v-model="item.chance">-->
    <!--<option v-for="option in chanceList" v-bind:value="option.value">-->
    <!--{{option.text}}-->
    <!--</option>-->
    <!--</select>-->
    <!--<span v-else>{{item.chance}}</span>-->
    <!--</td>-->
    <!--</tr>-->
    <!--</table>-->
    <table class="table  table-bordered text-center" v-if="isHasModule('todayCustomerTelVisit')">
        <tr>
            <td colspan="8" class="td-module">当日电访情况
                <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayCustomerTelVisit','CustomerSaler')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn"


                           @click="delRow('todayCustomerTelVisit')">删除一行</a>
                        </span>
            </td>
        </tr>
        <tr class="td-title">
            <td style="width: 95px;">客户电话</td>
            <td style="width: 74px;">客户来源</td>
            <td style="width: 60px;">姓名</td>
            <!--<td style="width: 60px;">客户生日</td>-->
            <!--<td  style="width: 70px;">陪同人员</td>-->
            <td style="width: 155px;" v-if="report.main.title.indexOf('大客户')!=-1">客户公司</td>
            <td style="width: 585px;">资金情况、来源(首付款金额)、已有设备(设备类型)、股东构成、行业经验、信誉、工程情况、竞争对手情况</td>

            <td style="width: 60px;">意向机型</td>
            <td style="width: 60px;">购买方式</td>
            <td style="width: 120px;">购买时间</td>

        </tr>
        <tr v-for="(item,i) in report.todayCustomerTelVisit">
            <td class="td-row2 width90 td-value1">
                <input v-if="pageType=='edit'" @blur="findCusByTel(item)" type="text" v-model="item.tel"/>
                <span v-else>{{item.tel}}</span>
            </td>
            <!--<td class="td-row2"><input type="text" v-model="item.source"/></td>-->
            <td class="td-row2 width60 td-value1">
                <select v-if="pageType=='edit'" v-model="item.source">
                    <option v-for="option in cusSource" v-bind:value="option.value">
                        {{option.text}}
                    </option>
                </select>
                <span v-else>{{item.source}}</span>
            </td>

            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.name"/>
                <span v-else>{{item.name}}</span>
            </td>
            <td class="td-row2 width60 td-value1" v-if="report.main.title.indexOf('大客户')!=-1">
                <input v-if="pageType=='edit'" type="text" v-model="item.companyName"/>
                <span v-else class="td-value" style="text-align: center !important;">{{item.companyName}}</span>
            </td>
            <!--<td class="td-row2 width60 td-value1">-->
            <!--<input v-if="pageType=='edit'" type="text" v-model="item.birthDay"/>-->
            <!--<span v-else>{{item.birthDay}}</span>-->
            <!--</td>-->
            <!--<td class="td-row2 width60">-->
            <!--<input v-if="pageType=='edit'" type="text" v-model="item.entourage"/>-->
            <!--<span v-else>{{item.entourage}}</span>-->
            <!--</td>-->
            <td class="td-row3 td-value">
                   <textarea v-if="pageType=='edit'"
                             v-model="item.otherCondition"></textarea>
                <span v-else>{{item.otherCondition}}</span>
            </td>
            <td class="td-row2 width60 td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.intentionModel"/>
                <span v-else>{{item.intentionModel}}</span>
            </td>
            <td class="width60 td-value1">
                <select v-if="pageType=='edit'" v-model="item.buyType">
                    <option v-for="option in buyTypeList" v-bind:value="option.value">
                        {{ option.text }}
                    </option>
                </select>
                <span v-else>{{item.buyType}}</span>
            </td>
            <td class="width60 td-value1">
                <select v-if="pageType=='edit'" v-model="item.buyDate">
                    <option v-for="option in buyDateList" v-bind:value="option.value">
                        {{option.text}}
                    </option>
                </select>
                <span v-else>{{item.buyDate}}</span>
            </td>
        </tr>
    </table>
    <table class="table  table-bordered text-center" v-if="isHasModule('visitLetterReason')">
        <tr>
            <td class="td-title width90 td-row2">未达到<br/>拜访量原因</td>
            <td class="td-row2 td-value">
                <textarea v-if="pageType=='edit'"
                          v-model="report.visitLetterReason.content"></textarea>
                <span v-else>{{report.visitLetterReason.content}}</span>
            </td>
        </tr>
    </table>
    <table class="table  table-bordered text-center" v-if="isHasModule('todayKnowVieSituation')">
        <tr>
            <td class="td-title width90 td-row2">当天知道<br/>丢单情况</td>
            <td style="width:240px;color: rgb(42, 140, 236) !important;">
                <select v-model="report.todayKnowVieSituation.vieFlag" v-if="pageType =='edit'">
                    <option value="1">有竞争丢单</option>
                    <option value="0">无竞争丢单</option>
                </select>

            </td>
            <td class="td-title width90">具体情况</td>
            <td class="td-row2 td-value">
                <textarea v-if="pageType=='edit'"
                          v-model="report.todayKnowVieSituation.remark"></textarea>
                <span v-else>{{report.todayKnowVieSituation.remark}}</span>
            </td>
        </tr>
    </table>
    <!--<table class="table  table-bordered text-center">-->
    <!--<tr v-if="isHasModule('workOnTodayDescsZjl')">-->
    <!--<td colspan="5" class="td-module" style="position: relative">-->
    <!--<span style="display: block;height: 20px;line-height: 20px;">今日面访/电访情况描述</span>-->
    <!--<span style="color: red;display: block;height: 20px;line-height: 20px;">(请使用APP中面访和电访按钮记录今日的拜访情况，否则此处不能填写，此处只能填写面访电访内容，其它内容请在《今日其它事务描述》中填写)</span>-->
    <!--<span class="span-a-btn" v-if="pageType=='edit'" style="top: 8px;right: -12px;">-->
    <!--<a href="javascript:void(0);" class="a-btn"-->
    <!--@click="addRow('workOnTodayDescsZjl','WorkOnTodayDescsZjl')">添加电访客户</a>-->
    <!--<a href="javascript:void(0);" class="a-btn"-->
    <!--@click="delRow('workOnTodayDescsZjl')">删除一行</a>-->

    <!--</span>-->
    <!--</td>-->
    <!--</tr>-->
    <!--<tr v-if="isHasModule('workOnTodayDescsZjl')" class="td-title">-->
    <!--<td style="width: 96px;">姓名</td>-->
    <!--<td style="width: 35px;">拜访方式</td>-->

    <!--<td>-->
    <!--<span style="margin-right: 145px;">情况描述</span>-->
    <!--</td>-->
    <!--</tr>-->
    <!--<tr v-if="isHasModule('workOnTodayDescsZjl')" v-for="(work,i) in report.workOnTodayDescsZjl">-->
    <!--<td class="td-row2 width60 td-value1"><input v-if="pageType=='edit'" type="text"-->
    <!--v-model="work.name"/>-->
    <!--<span v-else>{{work.name}}</span></td>-->
    <!--<td class="td-value" style="text-align: center !important;">-->
    <!--&lt;!&ndash;<select v-if="pageType=='edit'" v-model="work.visitMode">&ndash;&gt;-->
    <!--&lt;!&ndash;<option v-for="option in visitModelList" v-bind:value="option.value">&ndash;&gt;-->
    <!--&lt;!&ndash;{{option.text}}&ndash;&gt;-->
    <!--&lt;!&ndash;</option>&ndash;&gt;-->
    <!--&lt;!&ndash;</select>&ndash;&gt;-->
    <!--<span v-if="pageType=='edit'">{{work.visitMode}}</span>-->

    <!--<template v-else>-->
    <!--<span v-if="work.name==''"></span>-->
    <!--<span v-else>{{work.visitMode}}</span>-->
    <!--</template>-->

    <!--</td>-->
    <!--&lt;!&ndash;<td class="td-value">&ndash;&gt;-->
    <!--&lt;!&ndash;&lt;!&ndash;<input type="text" readonly placeholder="请选择县" v-model="item.county" @click="onfocus1(i)" class="selectModel" style="width: 61px;position: absolute;padding: 0px;height: 24px;line-height: 24px;border-right: 1px solid #ddd;text-align: center;">&ndash;&gt;&ndash;&gt;-->
    <!--&lt;!&ndash;&lt;!&ndash;<input type="text"  v-model="item.customerAddress" style="padding-left:61px;text-align: left;">&ndash;&gt;&ndash;&gt;-->
    <!--&lt;!&ndash;<input v-if="pageType=='edit'" type="text"&ndash;&gt;-->
    <!--&lt;!&ndash;v-model="work.visitAddress"/>&ndash;&gt;-->
    <!--&lt;!&ndash;<span v-else class="lineOne">{{work.visitAddress}}</span>&ndash;&gt;-->
    <!--&lt;!&ndash;</td>&ndash;&gt;-->
    <!--<td class="td-row3 td-value">-->
    <!--<textarea v-if="pageType=='edit'" v-model="work.visitContent"></textarea>-->
    <!--<span v-else v-html="work.visitContent"></span>-->
    <!--</td>-->
    <!--</tr>-->
    <!--</table>-->
    <table class="table  table-bordered text-center" v-if="isHasModule('workOnTodayDescsZjlNew')">
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <td colspan="3" class="td-module">
                <span v-if="isHasModule('workOnTodayDescsZjlNew')">当日工作情况描述</span>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <td class="td-title width90 td-row3">销售</td>
            <td>
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.saleList">
                        <td class="td-value td-row3" style="border-top: 0px;"
                            :style="i==report.workOnTodayDescsZjlNew.saleList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
            <td v-if="pageType=='edit'" style="width: 120px;height: 60px;line-height: 5px;">
                 <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                               @click="addRow('saleList','WorkOnTodayDesc')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                           @click="delRow('saleList')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <td class="td-title width90 td-row3">服务</td>
            <td>
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.serverList">
                        <td class="td-value td-row3" style="border-top: 0px;"
                            :style="i==report.workOnTodayDescsZjlNew.serverList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
            <td v-if="pageType=='edit'" style="width: 120px;height: 60px;line-height: 5px;">
                 <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                               @click="addRow('serverList','WorkOnTodayDesc')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                           @click="delRow('serverList')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <td class="td-title width90 td-row3">财务</td>
            <td>
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.financeList">
                        <td class="td-value td-row3" style="border-top: 0px;"
                            :style="i==report.workOnTodayDescsZjlNew.financeList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
            <td v-if="pageType=='edit'" style="width: 120px;height: 60px;line-height: 5px;">
                 <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                               @click="addRow('financeList','WorkOnTodayDesc')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                           @click="delRow('financeList')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <td class="td-title width90 td-row3">信控</td>
            <td>
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.diconList">
                        <td class="td-value td-row3" style="border-top: 0px;"
                            :style="i==report.workOnTodayDescsZjlNew.diconList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
            <td v-if="pageType=='edit'" style="width: 120px;height: 60px;line-height: 5px;">
                 <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                               @click="addRow('diconList','WorkOnTodayDesc')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                           @click="delRow('diconList')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <td class="td-title width90 td-row3">债权</td>
            <td>
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.bondList">
                        <td class="td-value td-row3" style="border-top: 0px;"
                            :style="i==report.workOnTodayDescsZjlNew.bondList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
            <td v-if="pageType=='edit'" style="width: 120px;height: 60px;line-height: 5px;">
                 <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                               @click="addRow('bondList','WorkOnTodayDesc')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                           @click="delRow('bondList')">删除一行</a>
                </span>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <td class="td-title width90 td-row3">行政人事</td>
            <td>
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.personList">
                        <td class="td-value td-row3" style="border-top: 0px;"
                            :style="i==report.workOnTodayDescsZjlNew.personList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
            <td v-if="pageType=='edit'" style="width: 120px;height: 60px;line-height: 5px;">
                 <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                               @click="addRow('personList','WorkOnTodayDesc')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn" style="color: #2a8cec;"
                           @click="delRow('personList')">删除一行</a>
                </span>
            </td>
        </tr>
    </table>
    <table class="table  table-bordered text-center" v-if="isHasModule('subordinateTodayWork')">
        <tr>
            <td colspan="5" class="td-module">
                <span>今日下属工作情况描述</span>
            </td>
        </tr>
        <tr class="td-title">
            <td style="width: 96px;">区域</td>
            <td style="width: 70px;">区域经理</td>
            <td style="width: 77px;">入职天数</td>
            <td style="width: 84px;">是否陪跑</td>
            <td>情况描述</td>
        </tr>
        <tr v-for="(subordinateWork,i) in report.subordinateWorkList">
            <td class="td-row3 td-value"><span
                    style="text-align: left !important;color: #0c0c0c !important;">{{subordinateWork.regionName}}</span>
            </td>
            <td><span style="color: #0c0c0c !important;"
                      class="oa-name">{{subordinateWork.reiongManagerName}}</span>
            </td>
            <td><span style="color: #0c0c0c !important;">{{subordinateWork.dayNumber}}</span></td>
            <td class="width60 td-value1">
                <select v-if="pageType=='edit'&&subordinateWork.reiongManagerId"
                        v-model="subordinateWork.haveAccompany"
                        style=" padding: 30px;">
                    <option value="否">否</option>
                    <option value="是">是</option>
                </select>
                <span v-else>{{subordinateWork.haveAccompany}}</span>
            </td>
            <td class="td-row3 td-value">
                <template v-if="pageType=='edit'">
                    <textarea v-model="subordinateWork.content"></textarea>
                </template>
                <span v-else v-html="subordinateWork.content"></span>
            </td>

        </tr>
    </table>
    <table class="table  table-bordered text-center" v-if="isHasModule('regionDirectorTodayWork')">
        <tr>
            <td colspan="5" class="td-module">
                <span>今日下属工作情况描述</span>
            </td>
        </tr>
        <tr class="td-title">
            <td style="width: 96px;">大区</td>
            <td style="width: 70px;">大区经理</td>
            <td style="width: 77px;">入职天数</td>
            <!--<td style="width: 84px;">是否陪同</td>-->
            <td>情况描述</td>
        </tr>
        <tr v-for="(subordinateWork,i) in report.regionDirectorWorkList">
            <td class="td-row3 td-value"><span
                    style="text-align: center !important;color: #0c0c0c !important;">{{subordinateWork.regionName}}</span>
            </td>
            <td><span style="color: #0c0c0c !important;"
                      class="oa-name">{{subordinateWork.reiongManagerName}}</span>
            </td>
            <td><span style="color: #0c0c0c !important;">{{subordinateWork.dayNumber}}</span></td>
            <!--<td class="width60 td-value1">-->
            <!--<select v-if="pageType=='edit'" v-model="subordinateWork.haveAccompany">-->
            <!--<option value="否">否</option>-->
            <!--<option value="是">是</option>-->
            <!--</select>-->
            <!--<span v-else>{{subordinateWork.haveAccompany}}</span>-->
            <!--</td>-->
            <td class="td-row3 td-value">
                <template v-if="pageType=='edit'">
                    <textarea v-model="subordinateWork.content"></textarea>
                </template>
                <span v-else v-html="subordinateWork.content"></span>
            </td>

        </tr>
    </table>
    <table class="table  table-bordered text-center">
        <tr v-if="isHasModule('workOnTodayDescs')">
            <td colspan="2" class="td-module">
                <span v-if="isHasModule('todayVisitCustomer')||isHasModule('workOnTodayDescsZjlNew')
                ||isHasModule('todayVisitCustomerDebt')">今日其它事务描述<span
                        style="color: red;">(除面访电访外的其它工作内容在此处填写)</span></span>
                <span v-else>当日工作情况描述</span>
                <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('workOnTodayDescs','WorkOnTodayDesc')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('workOnTodayDescs')">删除一行</a>

                </span>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescs')" v-for="(work,i) in report.workOnTodayDescs">
            <td class="td-title width90 td-row3">{{i+1}}</td>
            <td class="td-row3 td-value">
                <template v-if="pageType=='edit'">
                    <textarea v-if="isHasModule('todayVisitCustomer')||isHasModule('workOnTodayDescsZjl')"
                              v-model="work.content"></textarea>
                    <textarea v-else v-model="work.content"></textarea>

                </template>
                <span v-else v-html="work.content"></span>
            </td>
        </tr>
    </table>
    <table class="table  table-bordered text-center" v-if="isHasModule('jobDescriptionForBranch')">
        <tr>
            <td colspan="4" class="td-module">下属当日工作情况描述

                <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('jobDescriptionForBranch','Branch')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('jobDescriptionForBranch')">删除一行</a>

                        </span>
            </td>
        </tr>
        <tr>
            <td class="width90">姓名</td>
            <td class="width90">沟通方式</td>
            <td>沟通情况</td>
        </tr>
        <tr v-for="(item,i) in report.jobDescriptionForBranch">
            <td>
                <select v-model="item.branchName" @change="inferiorName(item)">
                    <option v-for="option in inferiorNameList" v-bind:value="option.name">
                        {{option.name}}
                    </option>
                </select>
            </td>
            <td><select>
                <option>电</option>
                <option>面</option>
            </select></td>
            <td><input type="text" v-model="item.exchange"></td>

        </tr>
    </table>
    <table class="table  table-bordered text-center" v-if="isHasModule('unfinishes')">
        <tr>
            <td colspan="5" class="td-module">未关闭事项跟踪
                <span class="span-a-btn" v-if="pageType=='edit'">
                    <a href="javascript:void(0);" class="a-btn" @click="addRow('unfinishes','Unfinish')">添加一行</a>
                    <a href="javascript:void(0);" class="a-btn" @click="delRow('unfinishes')">删除一行</a>


                </span>
            </td>
        </tr>
        <!--<tr class="td-title2">-->
        <!--<td class="width90 td-title"></td>-->
        <!--<td style="width:40%;">工作内容</td>-->
        <!--<td>进展情况</td>-->
        <!--<td class="width90">预计关闭时间</td>-->
        <!--</tr>-->
        <tr v-for="(item,i) in report.unfinishes">
            <td class="td-row2 td-title width90">{{i+1}}</td>
            <td class="td-row2 td-value" style="width:40%;">
                <textarea v-if="pageType=='edit'" v-model="item.trackContent"></textarea>
                <span v-else v-html="item.trackContent"></span>
            </td>
            <td class="td-row2 td-value">
                <textarea v-if="pageType=='edit'" v-model="item.jinzhan"></textarea>
                <span v-else v-html="item.jinzhan"></span>
            </td>
            <td class="td-row2 td-value width90">
                <textarea v-if="pageType=='edit'" v-model="item.overTime"
                          @focus="showDatePicker($event,item)"></textarea>
                <span v-else>{{item.overTime}}</span>
            </td>
            <!--<td class="td-row2">
                <input type="checkbox" v-model="item.jobState"/>
            </td>-->
        </tr>
    </table>
    <table class="table  table-bordered text-center" v-if="isHasModule('todayGatherSituation')">
        <tr>
            <td colspan="6" class="td-module">当天收款情况
                <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayGatherSituation','Gather')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('todayGatherSituation')">删除一行</a>
                        </span>
            </td>
        </tr>
        <tr>
            <td class="width90  td-title2">客户名称</td>
            <td style="width: 98px" class="td-title2">收款性质</td>
            <td style="width: 98px" class="td-title2">收款金额</td>
            <td style="width: 100px" class="td-title2">打款银行</td>
            <td class="td-title2">收款情况说明</td>
        </tr>
        <tr v-for="item in report.todayGatherSituation">
            <td class="td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.customerName"/>
                <span v-else>{{item.customerName}}</span>
            </td>
            <!--<td><input type="text" v-model="item.gatherType"/></td>-->
            <td class="td-value1">
                <select v-if="pageType=='edit'" v-model="item.gatherType">
                    <option v-for="option in gathering" v-bind:value="option.value">
                        {{option.text}}
                    </option>
                </select>
                <span v-else>{{item.gatherType}}</span>
            </td>
            <td class="td-value1">
                <input v-if="pageType=='edit'" type="number" v-model="item.money"/>
                <span v-else>{{item.money}}</span>
            </td>
            <td class="td-value1">
                <input v-if="pageType=='edit'" type="text" v-model="item.bank"/>
                <span v-else>{{item.bank}}</span>
            </td>
            <td class="td-value">
                <input v-if="pageType=='edit'" type="text" v-model="item.remark"
                       style="text-align: left !important;"/>
                <span v-else>{{item.remark}}</span>
            </td>
        </tr>
    </table>
    <table class="table  table-bordered text-center lastTable"
           v-if="isHasModule('todayCostDetail')">
        <tr>
            <td colspan="7" class="td-module">当日费用明细
                <span class="span-a-btn" v-if="pageType=='edit'">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayCostDetail2','Cost')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('todayCostDetail2')">删除一行</a>
                        </span>
            </td>
        </tr>
        <tr class="td-title2">
            <td style="width: 190px" colspan="2">费用名称</td>
            <td style="width: 100px">金额</td>
            <td style="width: 100px">有无发票</td>
            <td style="width: 100px">状态</td>
            <td>说明</td>
            <td>操作</td>
        </tr>
        <tr v-for="item in report.todayCostDetail">
            <td class="width90 td-value1">
                <span style="text-align:left">{{item.costBigName}}</span>
            </td>
            <td class="width90 td-value1" style="text-align:left">
                <input v-if="pageType=='edit'" type="text" v-model="item.costSmallName" style="text-align:center;"
                       readonly="readonly"/>
                <span class="lineOne" v-else>{{item.costSmallName}}</span>
            </td>

            <td class="td-value1">
                <input v-if="pageType=='edit'" type="number" style="text-align: center"
                       v-model="item.money" readonly="readonly"/>
                <span v-else>{{item.money}}</span>
            </td>
            <td class="td-value1">
                <span v-if="item.invoiceFlag=='1'">有</span>
                <span v-else>无</span>
            </td>
            <td class="td-value1" style="width: 100px">
                <span v-if="item.auditFlag=='0'">审核中</span>
                <span v-if="item.auditFlag=='1'">审核通过</span>
                <span v-if="item.auditFlag=='2'">驳回</span>
            </td>

            <td class="td-value">
                <input v-if="pageType=='edit'" type="text" v-model="item.remark"
                       style="text-align: left !important;"
                       readonly="readonly"/>
                <span class="lineOne" v-else>{{item.remark}}</span>
            </td>
            <td class="td-value1" style="width: 100px">
                <input type="hidden" v-model="item.id">
                <input type="button" align="center" style="background-color: white;border: 0px"
                       @click="gotoDetail(item.id)" value="查看费用详情">
            </td>
        </tr>

        <tr v-for="item in report.todayCostDetail2">
            <td class="width90 td-value1" style="text-align: center">
                <select v-if="pageType=='edit'" v-model="item.costBigId" style=" padding-left: 19px;"
                        @change="getExpenseChildName(item)">
                    <option v-for="option in costBigNameList" v-bind:value="option.id">
                        {{option.name}}
                    </option>
                </select>
                <span v-else>{{item.costBigName}}</span>
            </td>
            <td class="width90 td-value1">
                <select v-if="pageType=='edit'" v-model="item.costSmallId" style=" padding-left: 25px;"
                        @change="getExpenseSmallName(item)">
                    <option v-for="option in item.costSmallNameList" v-bind:value="option.id">
                        {{option.name}}
                    </option>
                </select>
                <span v-else>{{item.costSmallName}}</span>
            </td>
            <td class="td-value1">
                <input v-if="pageType=='edit'" type="number" style="text-align: center"
                       v-model="item.money"/>
                <span v-else>{{item.money}}</span>
            </td>
            <td class="td-value1">
                <select v-if="pageType=='edit'" v-model="item.invoiceFlag" class="haveInvoice"
                        style=" padding-left: 38px;">
                    <option v-for="option in invoiceFlagList" v-bind:value="option.value">
                        {{ option.text }}
                    </option>
                </select>
                <span v-else>{{getInvoiceFlagName(item.invoiceFlag)}}</span>
            </td>
            <td>

            </td>
            <td class="td-value">
                <input v-if="pageType=='edit'" type="text" v-model="item.remark"
                       style="text-align: left !important;"/>
                <span class="lineOne" v-else>{{item.remark}}</span>
            </td>
            <td>

            </td>
        </tr>
    </table>
    <table class="table  table-bordered text-center lastTable" v-if="isHasModule('weekVisitPlan')">
        <tr>
            <td colspan="7" class="td-module">周拜访计划</td>
        </tr>
        <tr>
            <td class="width90">日期</td>
            <td style="width: 98px;">客户名称</td>
            <td style="width: 98px;">上次拜访时间</td>
            <td style="width: 98px;">客户地点</td>
            <td style="width: 98px;">客户行业</td>
            <td style="width: 98px;">意向设备</td>
            <td>备注</td>
        </tr>
        <template v-if="report.weekPlan.length>0">
            <tr v-for="(item,i) in report.weekPlan">
                <td :rowspan="item.weekNamespan" class="td-value1"><span>{{item.weekName}}</span></td>
                <td class="td-value1">
                    <span>{{item.customerName}}</span>
                </td>
                <td class="td-value1">
                    <span>{{item.lastVisitTime}}</span>
                </td>
                <td class="td-value1">
                    <span>{{item.customerAddress}}</span>
                </td>
                <td class="td-value1">
                    <span>{{item.customerIndustry}}</span>
                </td>
                <td class="td-value1">
                    <span>{{item.intentionDevice}}</span>
                </td>
                <td class="td-value"><span class="lineOne">{{item.remake}}</span></td>
            </tr>
        </template>
        <template v-else>
            <td colspan="7">暂无周计划</td>
        </template>
    </table>
    <div style="text-align:center;padding: 10px 0" class="div-btn" v-if="endLoad =='true'">
        <input type="button" v-if="pageType=='edit' && report.main.flage == '-1'"
               style="width:100px;margin-top: -4px;"
               value="保存草稿"
               class="btn oaBtn btn-xs" @click="saveTraft"/>
        <input type="button" style="width:100px;margin-top: -4px;"
               v-if="pageType=='edit'&&(editable=='true'||userId == '20181225140445CD827D94AF9A96C367')"
               value="发送"
               class="btn oaBtn btn-xs" @click="OpenModle"/>
        <span v-if="pageType=='edit' && editable!='true' && userId != '20181225140445CD827D94AF9A96C367' "
              style="color:red;font-size:12px;">注：16:30前只能保存草稿</span>
        <!--&lt;!&ndash;过年期间代码 年后需要改回来&ndash;&gt;-->
        <!--<input type="button" style="width:100px;margin-top: -4px;"-->
        <!--value="发送"-->
        <!--class="btn oaBtn btn-xs" @click="OpenModle"/>-->
    </div>
    <!--&lt;!&ndash;过年期间代码 年后需要改回来&ndash;&gt;-->
    <!--<input type="button" style="width:100px;margin-top: -4px;"-->
    <!--value="发送"-->
    <!--class="btn oaBtn btn-xs" @click="OpenModle"/>-->
    </div>
    <div class="saveModle">
        <div class="top">
            <div class="title">选择人员</div>
            <div class="btn" v-on:click="closeModle"> x</div>
        </div>
        <div id="header" class="header box-body" style="padding: 25px 20px;padding-bottom: 0;">

            <div class="form-group">
                <label id="aReceivers" tabindex="-1">收件人</label>
                <div class="userbox form-control" id="receivers"
                     v-on:click.stop="inputFocus('txtReceiver')">
                    <div v-for="(user,i) in report.receivers" class="user"
                         v-bind:class="{ select:receiverSelectedIdx==i }"
                         v-on:click="selectUser(i,'receiverSelectedIdx')">{{user.userName}};
                    </div>
                    <input type="text" id="txtReceiver"
                           @keyup.delete="deleteUser('receivers','receiverSelectedIdx',$event)"/>
                </div>
            </div>
            <div class="form-group">
                <label for="txtCopier" id="aCopiers" tabindex="-1">抄送人</label>
                <div class="userbox form-control" id="copiers"
                     v-on:click.stop="inputFocus('txtCopier')">
                    <div v-for="(user,i) in report.copiers" class="user"
                         v-bind:class="{ select: copierSelectedIdx == i }"
                         v-on:click="selectUser(i,'copierSelectedIdx')">{{user.userName}};
                    </div>
                    <input type="text" id="txtCopier"
                           @keyup.delete="deleteUser('copiers','copierSelectedIdx',$event)"/>
                </div>
            </div>
        </div>
        <input type="button" value="发送" class="saveBtn btn oaBtn" @click="saveGo">
    </div>
    <div class="saveAddress">
        <div class="top">
            <div class="title">客户所在地</div>
            <div class="btn" v-on:click="closeAddress"> x</div>
        </div>
        <div class="header box-body" style="padding: 25px 20px;padding-bottom: 0;">

            <div class="form-group" style="overflow: hidden">
                <div class="addressTitle" style="letter-spacing: 3px;">客户所在县</div>
                <input type="text" class="addressValue xianValue selectModel" readonly placeholder="请选择县">
            </div>
            <div class="form-group" style="overflow: hidden">
                <div class="addressTitle">客户详细地址</div>
                <input type="text" class="addressValue xianxiValue">
            </div>
        </div>
        <input type="button" value="确定" class="saveBtn btn oaBtn" @click="saveAddressBtn">
    </div>
    <div class="modleBj"></div>
    <div v-if="isLook=='pingjia'&&userId!=wreportUserId&&pingjiaFlag=='true'">
        <table class="table  table-bordered text-center" style="margin-top: 10px;">
            <tr>
                <td colspan="2" class="td-module">报告评价</td>
            </tr>
            <tr>
                <td class="td-title width90" style="width: 96px">是否合格</td>
                <td class="">
                    <div style="float: left;width: 150px;text-align: center;position: relative">
                        <i :class="pingjia.evaluation=='合格'?'icon_wj icon_active_radio':'icon_wj icon_radio'"
                           v-if="isComment=='0'"
                           @click="changeEvaluation('合格')"></i>
                        <span class="evaluation" v-if="isComment=='0'"
                              :style="pingjia.evaluation!='合格'?'color: #bcb8b8 !important;':'color: #fff !important;background: rgb(42, 140, 236)'"
                              @click="changeEvaluation('合格')">合格<i
                                style="display: inline-block;width: 100%;height: 0;"></i></span>


                        <template v-else>
                            <i :class="pingjia.evaluation=='合格'?'icon_wj icon_active_radio':'icon_wj icon_radio'"
                               v-if="pingjia.evaluation=='合格'"></i>
                            <span class="evaluation" v-if="pingjia.evaluation=='合格'"
                                  :style="pingjia.evaluation!='合格'?'color: #bcb8b8 !important;':'color: #fff !important;background: rgb(42, 140, 236)'">合格<i
                                    style="display: inline-block;width: 100%;height: 0;"></i></span>
                        </template>
                    </div>
                    <div style="float: left;width: 150px;text-align: center;position: relative">
                        <i :class="pingjia.evaluation=='不合格'?'icon_wj icon_active_radio':'icon_wj icon_radio'"
                           v-if="isComment=='0'"
                           @click="changeEvaluation('不合格')"></i>
                        <span class="evaluation" v-if="isComment=='0'"
                              :style="pingjia.evaluation!='不合格'?'color: #bcb8b8 !important;':'color: #fff !important;background: rgb(42, 140, 236)'"
                              @click="changeEvaluation('不合格')">不合格<i
                                style="display: inline-block;width: 100%;height: 0;"></i></span>
                        <template v-else>
                            <i :class="pingjia.evaluation=='不合格'?'icon_wj icon_active_radio':'icon_wj icon_radio'"
                               v-if="pingjia.evaluation=='不合格'"></i>
                            <span class="evaluation" v-if="pingjia.evaluation=='不合格'"
                                  :style="pingjia.evaluation!='不合格'?'color: #bcb8b8 !important;':'color: #fff !important;background: rgb(42, 140, 236)'">不合格<i
                                    style="display: inline-block;width: 100%;height: 0;"></i></span>
                        </template>
                    </div>
                </td>
            </tr>
            <!--<tr>-->
            <!--<td class="td-title width90 td-row3">评价参考</td>-->
            <!--<td class="td-row3 " style="vertical-align: top;padding-bottom: 5px;">-->
            <!--<template>-->
            <!--<div class="pingjia"-->
            <!--v-for="item in pingjia.pingjia">-->
            <!--{{item.value}}-->
            <!--</div>-->
            <!--</template>-->
            <!--&lt;!&ndash;<template v-else>&ndash;&gt;-->
            <!--&lt;!&ndash;<div :class="item.select!='0'?'pingjia_active':'pingjia'" v-for="item in pingjia.pingjia">&ndash;&gt;-->
            <!--&lt;!&ndash;{{item.value}}&ndash;&gt;-->
            <!--&lt;!&ndash;</div>&ndash;&gt;-->
            <!--&lt;!&ndash;</template>&ndash;&gt;-->
            <!--</td>-->
            <!--</tr>-->
            <tr>
                <td class="td-title width90 td-row3" style="border-bottom-color: #DEDEDE !important;">评价描述</td>
                <td class="td-row3" v-if="isComment=='0'"
                    style="color: #2a8cec;border-bottom-color: #DEDEDE !important;">
                    <textarea v-model="pingjia.otherDescription"></textarea>
                </td>
                <td class="td-row3 td-value" v-else style="border-bottom-color: #DEDEDE !important;">
                    <span style="text-align: left;padding-left: 20px;"
                          class="lineOne">{{pingjia.otherDescription}}</span>
                </td>
            </tr>

        </table>
        <div style="text-align:center;padding: 10px 0" class="div-btn">
            <input type="button" v-if="isComment=='0'"
                   style="width:100px;margin-top: -4px;"
                   value="提交"
                   class="btn oaBtn btn-xs" @click="comment()"/>
        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<script>window.jQuery || document.write('<script src="/dist/plugins/jQuery/jquery-2.2.3.min.js"><\/script>', '<script src="/dist/plugins/bootstrap/js/bootstrap.min.js"><\/script>', '<script src="/dist/plugins/vue/vue.min.js"><\/script>')</script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=602456c3"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=666bff22"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
    $(function () {
        $("body").on("click", ".td-value ", function (e) {
            console.log(app.pageType)
            if (app.pageType == "edit") {
                return true;
            } else {
                if ($(".div-td-content-more").is(":hidden")) {
                    var text = $(this).html();
                    if (text != "") {
                        text = "<i></i>" + text;
                        $(".div-td-content-more").html(text).css({
                            "width": $(this).outerWidth() + "px",
                            "left": $(this).offset().left,
                            "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                        }).show();
                        e.stopPropagation();
                    }
                } else {
                    $(".div-td-content-more").hide();
                }
            }
        });

        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", ".visitGoalShow", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
            $("#entourage").hide();
        });
        $("body").on("click", ".selectModel", function (e) {
            if ($(".model-picker-dropdown").is(":hidden")) {
                $(".model-picker-dropdown").css({
                    "width": "275px",
                    "left": $(this).offset().left,
                    "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                }).show();
                e.stopPropagation();
            } else {
                $(".model-picker-dropdown").hide();
            }
        });
        $("body").on("click", ".model-select-tab a", function (e) {
            $(this).parent().find("a").removeClass("active");
            $(this).addClass("active");
            var boxName = $(this).attr("data-count");
            $(".model-select").hide();
            $(".model-select-content" + " ." + boxName).show();
        });
        $("body").on("click", ".model-select  a", function (e) {
//            if ($(this).hasClass("active")) {
//                return false;
//            }
            $(this).parent().find("a").removeClass("active");
            var id = $(this).attr("attr-id");
            $(this).addClass("active");
            var val = $(this).text();
            if ($(this).parents(".model-select").hasClass("type")) {
                $(".model-select-tab a").removeClass("active");
                $(".model-select-tab a[data-count=brand]").addClass("active");
                $(".model-select").hide();
                $(".xianValue").attr("data-shen", val);
                app.getCity(id);
                $(".model-select-content .brand").show();

            } else if ($(this).parents(".model-select").hasClass("brand")) {
                $(".model-select-tab a").removeClass("active");
                var id = $(this).attr("attr-id");
                $(".model-select-tab a[data-count=model]").addClass("active");
                $(".model-select").hide();
                $(".xianValue").attr("data-shi", val);
                app.getCounty(id);
                $(".model-select-content .model").show();

            } else {
                $(".xianValue").attr("data-xian", val);
                console.log(app.report.tomorrowVisitPlan);
                $(".xianValue").val($(".xianValue").attr("data-shen") + "-" + $(".xianValue").attr("data-shi") + "-" + $(".xianValue").attr("data-xian"));
                $(".model-picker-dropdown").hide();
            }
        })
        $("body").on("click", ".model-picker-dropdown", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".model-picker-dropdown").hide();
        });
    });

</script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            count: 0,
            pingjiaNum: 0,
            leftNum: 0,
            divInModel: '',
            intentlist: [],
            userType: '1',
            faceTarget: '0',
            userId: getCurrentUser().id,
            isLook: $.wyui.page.urlParams.isLook,
            wreportUserId: $.wyui.page.urlParams.wreportUserId,
            divInEntourage: '',
            intentFlag: '',
            serverCustomerType: [],
            receiversFlag: 'false',
            receiversUserIds: '',
            selectCom: '提车公司',
            selectType: '设备类型',
            selectBran: '品牌',
            selectMod: '型号',
            list: [],
            pingjiaFlag: "false",
            pingjia: {
                evaluation: "",
                pingjia: [],
                pingjiaList: [],
                pingjiaStrings: "",
                otherDescription: "",
                createUserId: getCurrentUser().id,
                createUserName: getCurrentUser().name
            },
            commentList: [],
            commentTitle: "",
            commentTishi: "",
            isComment: $.wyui.page.urlParams.isComment ? $.wyui.page.urlParams.isComment : '0',
            itemsCom: [],
            itemsBran: [],
            itemsType: [],
            itemsMod: [],
            provinceList: [],
            cityList: [],
            countyList: [],
            entourage: [],
            deleteList: '',
            pageType: 'edit',//如果pageType=edit说明是编辑页面，如果pagetype=browser，说明是查看页面
            endLoad: '',
            editable: $.wyui.page.urlParams.editable,
            flage: $.wyui.page.urlParams.flage,
            dateReissueEnd: $.wyui.page.urlParams.dateReissueEnd,
            roleName: getCurrentUser().roleName,
            currentfocus: 0,
            cusSource: [
                {text: '销售录入', value: '销售录入'},
                {text: '易企秀', value: '易企秀'},
                {text: '400', value: '400'},
                {text: '其他', value: '其他'}
            ],
            customerCredit: [
                {text: '未知', value: '未知'},
                {text: '合格', value: '合格'},
                {text: '不合格', value: '不合格'}
            ],
            customerType: [],
            serverVisitType: [],
            feeType: [],
            debtVisitType: [],
            lettersVisitType: [],
            gathering: [
                {text: '银行欠款', value: '银行欠款'},
                {text: '配件欠款', value: '配件欠款'},
                {text: '首付垫款', value: '首付垫款'},
                {text: '以租代售租金', value: '以租代售租金'},
                {text: '服务费', value: '服务费'},
                {text: '银行垫款', value: '银行垫款'},
                {text: '以租代售的定金', value: '以租代售的定金'},
                {text: '其他', value: '其他'}
            ],
            costBigNameList: [],
            inferiorNameList: [],
            templates: [],
            currentUserTel: '',
            buyDateList: [
                {text: '本月内', value: '本月内'},
                {text: '下月内', value: '下月内'},
                {text: '三月内', value: '三月内'},
                {text: '半年内', value: '半年内'},
                {text: '已成交', value: '已成交'},
                {text: '丢单', value: '丢单'},
            ],
            intent: [
                {text: '是', value: '1'},
                {text: '否', value: '0'},
            ],
            chanceList: [
                {text: '<50%', value: '<50%'},
                {text: '50%', value: '50%'},
                {text: '75%', value: '75%'},
                {text: '100%', value: '100%'},
            ],
            buyTypeList: [
                {text: '全款', value: '全款'},
                {text: '内部分期', value: '内部分期'},
                {text: '融资租赁', value: '融资租赁'}
            ],

            visitModelList: [
                {text: '1', value: '1'},
                {text: '0', value: '0'}
            ],
            visitGoalList: [
                {text: '首次拜访', value: '首次拜访'},
                {text: '重复拜访', value: '重复拜访'},
                {text: '意向跟踪', value: '意向跟踪'},
                {text: '扫村扫街', value: '扫村扫街'}
            ],
            visitBigGoalList: [
                {text: '意向跟踪', value: '意向跟踪'},
                {text: '陪同跑动', value: '陪同跑动'},
                {text: '其它', value: '其它'},
                {text: '扫村扫街', value: '扫村扫街'}
            ],
            invoiceFlagList: [
                {text: '无', value: '0'},
                {text: '有', value: '1'}
            ],
            report: {
                tomorrowVisitPlan: [],
                weekPlan: [],
                handAddCopiers: [],
                handAddReceivers: [],
                receivers: [],
                copiers: [],
                subordinateWorkList: [],
                regionDirectorWorkList: [],
                main: {
                    id: '0',
                    title: '',
                    reportDate: this.reportDate,
                    userId: '',
                    moduleENames: "",
                    flage: '-1',
                    draft: 0
                },
                experience: {content: '', type: 1},//心得体会
                tomorrowAMPlan: {content: '', type: 6},//次日上午计划
                tomorrowPMPlan: {content: '', type: 7},//次日下午计划
                tomorrowPlan: {content: '', type: 3},//第二天计划
                personSituation: {content: '', type: 2},//人员情况
                troubleShooting: [//未处理前三个疑难故障
                    new Template.Unfinish('1'),
                    new Template.Unfinish('1'),
                    new Template.Unfinish('1')
                ],
                visitLetterReason: {content: '', type: 9},//未达到拜访量原因
                todayKnowVieSituation: {id: '', wId: '', vieFlag: '', remark: ''},//丢单原因
                forSupportMatters: [//需要公司支持的事项
                    new Template.Unfinish('2')
                ],
                workOnTodayDescs: [//当日工作情况描述
                    new Template.WorkOnTodayDesc()
                ],
                workOnTodayDescsZjl: [
                    new Template.WorkOnTodayDescsZjl()
                ],
                workOnTodayDescsZjlNew: {
                    saleList: [new Template.WorkOnTodayDescsZjl()],
                    serverList: [new Template.WorkOnTodayDescsZjl()],
                    financeList: [new Template.WorkOnTodayDescsZjl()],
                    diconList: [new Template.WorkOnTodayDescsZjl()],
                    bondList: [new Template.WorkOnTodayDescsZjl()],
                    personList: [new Template.WorkOnTodayDescsZjl()],
                },
                unfinishes: [//未关闭事项
                    new Template.Unfinish('3')
                ],
                todayCustomerVisit: [//当日拜访情况(面访)
                    new Template.CustomerSaler()
                ],
                todayVisitCustomer: [//当日拜访情况(拜访)
                    new Template.CustomerSalerVisit()
                ],
                todayVisitCustomerBigRegion: [//当日拜访情况(大区拜访)
                    new Template.CustomerSalerVisitRegion()
                ],
                todayCustomerTelVisit: [//当日拜访情况(电访)
                    new Template.CustomerSalerTel()
                ],
                todayCostDetail: [//当日通过的临时费用
                    new Template.Cost()
                ],
                todayCostDetail2: [//当日费用明细
                    new Template.Cost()
                ],
                jobDescriptionForBranch: [//下属工作情况-大区经理
                    new Template.Branch()
                ],
                todayGatherSituation: [//当天收款情况
                    new Template.Gather()
                ]
            },
            receiverSelectedIdx: -1,
            copierSelectedIdx: -1
        },
        methods: {
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
            getNextDate: function (date, day) {
                var dd = new Date(date);
                dd.setDate(dd.getDate() + day);
                var y = dd.getFullYear();
                var m = dd.getMonth() + 1 < 10 ? "0" + (dd.getMonth() + 1) : dd.getMonth() + 1;
                var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();
                return y + "-" + m + "-" + d;
            },
            changeEvaluation: function (evaluation) {
                var that = this;
                if (that.pingjia.evaluation == evaluation) {
                    that.pingjia.pingjiaList = [];
                    that.pingjia.pingjia = [];
                    that.pingjia.pingjiaStrings = "";
                    that.pingjia.evaluation = ""
                } else {
                    that.pingjia.evaluation = evaluation
                    that.pingjia.pingjiaList = [];
                    that.pingjia.pingjiaStrings = "";
                    if (that.pingjia.evaluation == "合格") {
                        //查询合格的enum
                        that.getGrade("pingjia")
                    }
                    if (that.pingjia.evaluation == "不合格") {
                        that.getGrade("pingjia1")
                    }
                }

            },
            checkedPingjia: function (item, value) {
                console.log(item)
                if (item.select == "0") {
                    item.select = "1"
                } else {
                    item.select = "0"
                }
                var idIndex = this.pingjia.pingjiaList.indexOf(value)
                if (idIndex >= 0) {
                    this.pingjia.pingjiaList.splice(idIndex, 1)
                } else {
                    this.pingjia.pingjiaList.push(value)
                }
                var pingjiaString = "";
                if (this.pingjia.pingjiaList.length > 0) {
                    for (var i = 0; i < this.pingjia.pingjiaList.length; i++) {
                        if (this.pingjia.pingjiaList[i] != "") {
                            pingjiaString += this.pingjia.pingjiaList[i] + "|";
                        }
                    }
                    this.pingjia.pingjiaStrings = pingjiaString.substring(0, pingjiaString.length - 1);
                } else {
                    this.pingjia.pingjiaStrings = ""
                }
                console.log(this.pingjia.pingjiaStrings)

            },
            checkedOne: function (moduleKey, index) {
                var idIndex = this.report.todayVisitCustomer[index].checkedServerCustomerLists.indexOf(moduleKey)
                if (idIndex >= 0) {
                    this.report.todayVisitCustomer[index].checkedServerCustomerLists.splice(idIndex, 1)
                } else {
                    this.report.todayVisitCustomer[index].checkedServerCustomerLists.push(moduleKey)
                }

                console.log(this.report.todayVisitCustomer[index].checkedServerCustomerLists);
            },
            clearData: function (i) {
                this.report.tomorrowVisitPlan[i].customerName = "";
            },
            getEntourage: function (event, i, type) {
                var that = this;
                var visitGoal = that.report.tomorrowVisitPlan[i].visitGoal;
                console.log(visitGoal)
                if (visitGoal == '陪同跑动' || visitGoal == '意向跟踪' || visitGoal == '其它' || visitGoal == '首次拜访' || visitGoal == '重复拜访' || visitGoal == '扫村扫街') {
                    var inputId = '#entourage' + i
                    $(inputId).attr("readonly", "readonly");
                    that.showDivEntourage(event, type);
                }
            },
            onfocus1: function (i) {
                var that = this;
                that.currentfocus = i;
            },
            goIntent: function (i, item) {
                if (item.intentionFlag == '1') {
                    var index = i;
                    var itemCus = item;
                    console.log(i, item)
                    itemCus.createUserId = getCurrentUser().id
                    $.wyui.postMethod('/wreportCustomer/save.json', trimRN(itemCus), function (r) {
                        itemCus.customerId = r.id;
                        console.log(r.id)
                        if (itemCus.customerId && itemCus.customerId != '') {
                            var H = $(window).height() - 50;
                            top.$.dialog({
                                content: 'url:/page/intentionManagement/quYuIntentionalDetailApp.html?customerId=' + itemCus.customerId + '&isAdd=0&pageType=edit&userId=' + getCurrentUser().id + '&companyId=' + getCurrentUser().companyId + '&isRegion=1&type=pc&index=' + index,
                                title: '意向客户详情',
                                width: 500,
                                height: H,
                                max: true,
                                min: true,
                                lock: true,
                            });
                        }
                    })
                }
            },
            comment: function () {
                var that = this;
                var data = {};
                data.dataId = that.report.main.id;
                data.createUserId = getCurrentUser().id;
                data.createUserName = getCurrentUser().name;
                data.evaluation = that.pingjia.pingjiaStrings;
                data.otherDescription = that.pingjia.otherDescription;
                data.grade = that.pingjia.evaluation;
                data.wreportUserId = that.report.main.userId;
                data.reportDate = that.report.main.reportDate;
                data = trimRN(data);
                if (data.grade && data.grade != '') {
                    if (data.otherDescription == '') {
                        alert("请填写评论描述")
                        return false
                    }
                }
                $.wyui.postMethod("/wreport/savePingjia.json", trimRN(data), function (data) {
                    console.log(data)
                    if (data.records) {
                        that.showModel(200, "提交成功")
                        var pageId = top.getActivePageId();
                        top.refreshTabById(pageId);
                    }
                });
            },
            get_customerList_regionManager: function () {
                var that = this;
                var flag = false;
                $.wyui.postMethod(urlConfig.intentionCustomerManagement.getCustomerListByCreateUserId, {
                    "userId": getCurrentUser().id,
                    "buyDate": '',
                    "key": ''
                }, function (data) {
                    console.log(data.records)
                    for (var i = 0; i < data.records.length; i++) {
                        console.log(that.isUnDone(data.records[i]))
                        if (that.isUnDone(data.records[i])) {
                            flag = true;
                            break;
                        }
                    }
                }, true);
                return flag;
                console.log(flag)
            },
            isUnDone: function (item) {
                if (
                    (
                        item.customerName == "" ||
                        item.customerTel == "" ||
                        item.customerType == "" ||
                        item.customerCredit == "" ||
                        item.source == "" ||
                        item.chance == "" ||
                        item.countyName == "" ||
                        item.intentionBrand == "" ||
                        item.intentionModel == "" ||
                        item.existingDevice == "" ||
                        item.buyDate == "" ||
                        item.workingExperience == "" ||
                        item.buildCondition == "" ||
                        item.revenueForecast == "" ||
                        item.competitorCondition == "" ||
                        item.updateTime != new Date().Format("yyyy-MM-dd")
                    )
                ) {
                    return true
                } else {
                    return false
                }
            },
            getWeek: function () {
                var that = this;
                const week = [];
                for (var i = 0; i < 6; i++) {
                    var Stamp = new Date();
                    var num = 7 - Stamp.getDay() + 1 + i;
                    Stamp.setDate(Stamp.getDate() + num);
                    var mvar = '';
                    if ((Stamp.getMonth() + 1) > 10) {
                        mvar = (Stamp.getMonth() + 1);
                    } else {
                        mvar = '0' + (Stamp.getMonth() + 1);
                    }
                    var dvar = '';
                    if (Stamp.getDate() < 10) {
                        dvar = '0' + Stamp.getDate();
                    } else {
                        dvar = Stamp.getDate() + '';
                    }
                    if ((Stamp.getMonth() + 1) > 10) {
                    } else {
                    }
                    week[i] = Stamp.getFullYear() + '-' + mvar + '-' + dvar;
                    console.log(week[i]);
                }
                that.week = week;
            },
            initData: function () {
                var that = this;
                that.getWeek();
                var tomorrowVisitPlan = [
                    {
                        "createTime": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "customerIndustry": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "county": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "entourage": "",
                    }, {
                        "createTime": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "county": "",
                        "customerIndustry": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "county": "",
                        "entourage": "",
                    }, {
                        "createTime": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "customerIndustry": "",
                        "county": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "entourage": "",
                    },
                    {
                        "createTime": "",
                        "county": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "customerIndustry": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "entourage": "",
                    }, {
                        "createTime": "",
                        "county": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "customerIndustry": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "entourage": "",
                    }, {
                        "createTime": "",
                        "county": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "customerIndustry": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "entourage": "",
                    }
                ]
                that.report.tomorrowVisitPlan = tomorrowVisitPlan;
            },
            formatDate: function (now) {
                return new Date(now).Format(TimeFormat.middle)
            },
            refreshWeek: function () {
                var that = this;
                $.wyui.postMethod('/weekPlan/getWeek.json', {
                    reportDate: that.report.main.reportDate,
                    createUserId: getCurrentUser().id
                }, function (r) {
                    console.log(r)
                    if (r.records.length > 0) {

                        console.log(r.records)
                        that.report.weekPlan = that.tablesMergeCell(r.records);
                    } else {
                        that.report.weekPlan = ""
                        console.log(that.report.weekPlan)
                    }
                    //console.log(r);

                })
            },
            getDateStr: function (dayCount) {
                var that = this;
                if (null == dayCount) {
                    dayCount = 0;
                }
                var dd = new Date(that.report.main.reportDate);

                dd.setDate(dd.getDate() + dayCount);//设置日期
                var y = dd.getFullYear();
                var m = dd.getMonth() + 1;//获取当前月份的日期
                var d = dd.getDate();
                if (m < 10) {
                    if (d < 10) {
                        return y + "-" + "0" + m + "-0" + d;
                    } else {
                        return y + "-" + "0" + m + "-" + d;
                    }
                } else {
                    if (d < 10) {
                        return y + "-" + m + "-0" + d;
                    } else {
                        return y + "-" + m + "-" + d;
                    }
                }


            },
            refreshTomorrow: function () {
                var that = this;
                console.log(this.getDateStr(1));
                $.wyui.postMethod('/weekPlan/getWeek.json', {
                    createUserId: getCurrentUser().id,
                    weekTime: this.getDateStr(1),
                    reportDate: that.report.main.reportDate,
                }, function (r) {
                    console.log(r.records);
                    if (r.records.length > 0) {
                        that.report.tomorrowVisitPlan = r.records;
                    } else {
                        that.report.tomorrowVisitPlan = [new Template.TomorrowVisitPlan()];
                    }

                })
            },
            getInvoiceFlagName: function (invoiceFlag) {
                var name = "";
                for (var i = 0; i < this.invoiceFlagList.length; i++) {
                    if (invoiceFlag == this.invoiceFlagList[i].value) {
                        name = this.invoiceFlagList[i].text;
                        break;
                    }
                }
                return name;
            },
            inputFocus: function (id) {
                $("#" + id).focus();
            },
            selectUser: function (i, prop) {
                this.receiverSelectedIdx = -1;
                this.copierSelectedIdx = -1;
                this[prop] = i;
            },
            unselectUser: function () {
                this.receiverSelectedIdx = -1;
                this.copierSelectedIdx = -1;
            },
            deleteUser: function (prop, idx, event) {
                if (event.keyCode == 46 || event.keyCode == 8 && event.target.value == "") {
                    if (this[idx] > -1) {
                        var userId = this.report[prop][this[idx]].userId;
                        // if (this.deleteList.indexOf(this.report[prop][this[idx]].userId) == -1) {
                        this.report[prop].splice(this[idx], 1);
                        this.receiverSelectedIdx = -1;
                        this.copierSelectedIdx = -1;
                        for (var i = 0; i < this.report.handAddReceivers.length; i++) {
                            if (this.report.handAddReceivers[i].userId == userId) {
                                this.report.handAddReceivers.splice(i, 1);
                            }
                        }
                        for (var i = 0; i < this.report.handAddCopiers.length; i++) {
                            if (this.report.handAddCopiers[i].userId == userId) {
                                this.report.handAddCopiers.splice(i, 1);
                            }
                        }
                        //  }
                        this.receiverSelectedIdx = -1;
                        this.copierSelectedIdx = -1;
                    } else {
                        this[idx] = this.report[prop].length - 1;
                    }
                }
            },
            getNum: function (moudleNames) {
                var that = this;
                var num = 0;
                if (moudleNames.indexOf("experience") != -1) {
                    num = num + 1
                }
                if (moudleNames.indexOf("personSituation") != -1) {
                    num = num + 1
                }
                if (moudleNames.indexOf("tomorrowPlan") != -1) {
                    num = num + 1
                }
                if (moudleNames.indexOf("troubleShooting") != -1) {
                    num = num + 3
                }
                if (moudleNames.indexOf("forSupportMatters") != -1) {
                    num = num + 2
                }
                //如果是5行，不用改变，如果少五行，先添加需要支持事项，在比较
                console.log(moudleNames, Number(num), Number(that.commentList.length + 1))
                if (5 - Number(num) >= 0) {
                    that.leftNum = Math.abs(5 - Number(num))
                }
                return Number(num + that.leftNum) - Number(that.commentList.length + 1)

            },
            getreceiver: function () {
                var that = this;
                $.wyui.postMethod('/wreport/getreceiver.json', {
                    'userId': getCurrentUser().id,
                    'dataId': $.wyui.page.urlParams.id
                }, function (r) {
                    console.log(r)
                    that.userType = r.userType
                });
            },
            beforeClose: function (id) {
                var that = this;
                if (that.report.main.title.indexOf("区域经理") != -1) {
                    if (getCurrentUser().roleName == '区域总监'
                        || getCurrentUser().roleName == '区域支持'
                        || getCurrentUser().roleName == '销售管理'
                    ) {
                        that.userType = '0'
                    }
                }
                console.log(that.userType, that.isComment)
                console.log(that.wreportUserId, that.userId)
                if (that.userType == '0') {
                    //必须评价
                    if (that.isComment == '0' && that.report.main.title.indexOf("区域经理") != -1) {
                        alert("请评价该工作报告")
                    } else {
                        that.getWhetherFirstAndAddOrUpdate()
                        top.closeTabByPageId(id)
                    }
                } else {
                    that.getWhetherFirstAndAddOrUpdate()
                    top.closeTabByPageId(id)
                }
            },
            getWhetherFirstAndAddOrUpdate: function () {
                var that = this;
                if (that.wreportUserId && that.wreportUserId != that.userId) {
                    $.wyui.postLoadMethod('/module/getWhetherFirstReading.json',
                        {
                            wid: $.wyui.page.urlParams.id,
                            userId: getCurrentUser().id
                        },
                        function (r) {
                            if (r && r.id && !r.closeTime) {
                                $.wyui.postLoadMethod('/module/saveReordTime.json',
                                    {
                                        id: r.id,
                                        dataId: r.dataId,
                                        createUserId: r.createUserId,
                                        createUserName: r.createUserName
                                    }, function (r) {
                                        console.log(r.id)
                                    }, true, false
                                )
                            }
                        }, true, false)
                }
            },
            findCusByTel: function (customer) {
                customer.tel = customer.tel.replaceAll(" ", "")
                var that = this;
//                for(var i=0;i<that.report.todayVisitCustomer.length;i++){
//                    if(i!=index){
//                        if(that.report.todayVisitCustomer[i].tel && that.report.todayVisitCustomer[i].tel ==customer.tel){
//                            alert("已存在当前客户电话，请重新填入！");
//                            $(".td-row2 select").focus();
//                            return ;
//                        }
//                    }
//                };
                $.ajax({
                    url: server.ip + "/wreport/getCustomerByTel.json",
                    data: JSON.stringify({tel: customer.tel}),
                    success: function (r) {
                        console.log(r.data.sendData)
                        if (!r.e.code && r.data.sendData) {
                            var data = r.data.sendData;
                            customer.customerId = data.id;
                            for (var p in data) {
                                console.log(p)
                                customer[p] = data[p];

                            }
                        }
                    }
                });
            },
            getAllTemplates: function () {
                var that = this;
                $.wyui.postLoadMethod(urlConfig.wreport.config.template.getTreeNodes, {}, function (templates) {
                    that.templates = [];
                    for (var i = 0; i < templates.length; i++) {
                        if (templates[i].id != "0") {
                            that.templates.push(templates[i]);
                        }
                    }
                }, false, false);
            },
            abs: function (as) {
                return Math.abs(as)
            },
            getModulesByTemplateId: function (templateId) {
                var that = this;
                var arrModules = new Array();
                $.wyui.postLoadMethod(urlConfig.wreport.config.template2Module.getByTemplateId, {
                    templateId: templateId
                }, function (t2m) {
                    for (var i = 0; i < t2m.length; i++) {
                        $.wyui.postMethod(urlConfig.wreport.config.module.getById, {id: t2m[i].moduleId}, function (module) {
                            arrModules.push(module.eName);
                        }, true);
                    }
                    that.report.main.moduleENames = arrModules.join(',');
                    console.log(that.report)
                    that.report = reportCountFixed(that.report);
                    that.pingjiaNum = that.getNum(that.report.main.moduleENames)
                    if (that.pingjiaNum < 0) {
                        that.leftNum = that.leftNum + Math.abs(that.pingjiaNum)
                    }
                }, false, true);
            },
            isHasModule: function (moduleEName) {
                var arrModuleENames = this.report.main.moduleENames.split(',');
                return $.inArray(moduleEName, arrModuleENames) > -1;
            },
            addRow: function (prop, template) {
                if (prop == "forSupportMatters") {
                    this.report[prop].push(new Template.Unfinish('2'));
                } else if (prop == "unfinishes") {
                    this.report[prop].push(new Template.Unfinish('3'));
                } else if (prop == "tomorrowVisitPlan2") {
                    this.report.tomorrowVisitPlan.push(new Template[template]());
                    this.report.tomorrowVisitPlan.push(new Template[template]());
                    this.report.tomorrowVisitPlan.push(new Template[template]());
                } else if (prop == "saleList" || prop == "serverList" || prop == "financeList" || prop == "diconList" || prop == "bondList" || prop == "personList") {
                    this.report.workOnTodayDescsZjlNew[prop].push(new Template[template]());
                } else {
                    this.report[prop].push(new Template[template]());
                }
            },
            delRow: function (prop) {
                if (prop == "tomorrowVisitPlan2") {
                    this.report.tomorrowVisitPlan.splice(this.report.tomorrowVisitPlan.length - 3, 3);
                } else if (prop == "saleList" || prop == "serverList" || prop == "financeList" || prop == "diconList" || prop == "bondList" || prop == "personList") {
                    if (this.report.workOnTodayDescsZjlNew[prop].length == 1) {
                        alert("请保留最少一行")
                    } else {
                        this.report.workOnTodayDescsZjlNew[prop].splice(this.report.workOnTodayDescsZjlNew[prop].length - 1, 1);
                    }
                } else {
                    this.report[prop].splice(this.report[prop].length - 1, 1);
                }


            },
            showDatePicker: function (e, item) {
                WdatePicker({
                    onpicked: function (dp) {
                        item.overTime = dp.cal.getNewDateStr();
                        item.lastVisitTime = dp.cal.getNewDateStr();
                        return true;
                    }
                });
                $(e.target).blur();
            },
            getExpenseChildName: function (cost) {
                var that = this;
                for (var i = 0; i < this.costBigNameList.length; i++) {
                    if (this.costBigNameList[i].id == cost.costBigId) {
                        cost.costBigName = this.costBigNameList[i].name;
                    }
                }
                service.getExpensesByParentId({parentId: cost.costBigId, userId: getCurrentUser().id}, function (data) {
                    cost.costSmallNameList = data;
                });
            },
            getExpenseSmallName: function (COST) {
                var that = this;
                for (var i = 0; i < COST.costSmallNameList.length; i++) {
                    if (COST.costSmallNameList[i].id == COST.costSmallId) {
                        COST.costSmallName = COST.costSmallNameList[i].name;
                    }
                }
            },
            closeModle: function () {
                $(".modleBj").hide();
                $(".saveModle").hide();
            },
            openAddress: function (index) {
                $(".modleBj").show();
                $(".saveAddress").show();
                $(".saveAddress").attr("data-index", index);
                $(".xianValue").val("");
                $(".xianxiValue").val("");
                $(".xianValue").attr("data-xian", "");
            },
            closeAddress: function () {
                $(".modleBj").hide();
                $(".saveAddress").hide();
            },
            saveAddressBtn: function () {
                var xian = $(".xianValue").attr("data-xian");
                var xianxi = $(".xianxiValue").val();
                var index = $(".saveAddress").attr("data-index");
                if (!xian) {
                    alert("请选择客户所在县");
                    return false;
                }
                if (xianxi == '') {
                    alert("请填写客户详细地址");
                    return false;
                }
                if (this.isHasModule('workOnTodayDescsZjl')) {
                    app.report.workOnTodayDescsZjl[index].customerAddress = xian + xianxi;
                } else {
                    app.report.tomorrowVisitPlan[index].customerAddress = xian + xianxi;
                }
                console.log(xian + xianxi)
                $(".modleBj").hide();
                $(".saveAddress").hide();
            },
            OpenModle: function () {
                var num = 0;

                if (getCurrentUser().roleName == "大区经理" || getCurrentUser().roleName == "区域总监") {
                    for (var i = 0; i < this.report.tomorrowVisitPlan.length; i++) {
                        if (this.report.tomorrowVisitPlan[i].customerName != "" || this.report.tomorrowVisitPlan[i].customerAddress != "" || this.report.tomorrowVisitPlan[i].visitGoal) {
                            if (this.report.tomorrowVisitPlan[i].customerName == "") {
                                alert("请填写客户名称！");
                                return false;
                            }
                            if (!this.report.tomorrowVisitPlan[i].visitGoal && this.report.tomorrowVisitPlan[i].customerName != "请假") {
                                alert("请选择拜访目的！");
                                return false;
                            }
                            if ((getCurrentUser().roleName == "大区经理" || getCurrentUser().roleName == "区域总监") && getCurrentUser().id != '20180319111240919FEBB3615DA13C37') {
                                if (!this.report.tomorrowVisitPlan[i].entourage && this.report.tomorrowVisitPlan[i].customerName != "请假") {
                                    alert("请选择陪同人员！");
                                    return false;
                                }
                            }
                            if (this.report.tomorrowVisitPlan[i].customerAddress == "" && this.report.tomorrowVisitPlan[i].customerName != "请假") {
                                alert("请填写客户地点！");
                                return false;
                            }


                            num++;
                        }
                    }
//                    if (getCurrentUser().roleName == "区域经理" && num < 3) {
//                        if (this.report.tomorrowVisitPlan[0].visitGoal != "意向跟踪" && this.report.tomorrowVisitPlan[0].customerName != "请假") {
//                            alert("请至少填写3条计划！");
//                            return false;
//                        }
//                    }
                    console.log(getCurrentUser().roleName)
                    /*if (getCurrentUser().roleName == "大区经理" && num < 1) {
                     alert("请至少填写1条计划！");
                     return false;
                     }*/
//                    if (getCurrentUser().roleName == "区域总监" && num < 1) {
//                        alert("请至少填写1条计划！");
//                        return false;
//                    }

                }
                // if (getCurrentUser().roleName == "大客户经理") {
                //     for (var i = 0; i < this.report.tomorrowVisitPlan.length; i++) {
                //         if (this.report.tomorrowVisitPlan[i].customerName != "" || this.report.tomorrowVisitPlan[i].customerAddress != "" || this.report.tomorrowVisitPlan[i].lastVisitTime != "" || this.report.tomorrowVisitPlan[i].customerIndustry != "" || this.report.tomorrowVisitPlan[i].intentionDevice != "") {
                //             if (this.report.tomorrowVisitPlan[i].customerName == "") {
                //                 alert("请填写客户名称！");
                //                 return false;
                //             }
                //             if (this.report.tomorrowVisitPlan[i].customerAddress == "") {
                //                 alert("请填写客户地点！");
                //                 return false;
                //             }
                //
                //             if (this.report.tomorrowVisitPlan[i].customerIndustry == "") {
                //                 alert("请填写客户行业！");
                //                 return false;
                //             }
                //             if (this.report.tomorrowVisitPlan[i].intentionDevice == "") {
                //                 alert("请填写意向设备！");
                //                 return false;
                //             }
                //         }
                //     }
                // }
                //if是销售人员
                //if (getCurrentUser().roleName == "区域经理" || getCurrentUser().roleName == "大区经理") {
//                    for(var i=0;i<this.report.todayCustomerVisit.length;i++){
//                        var data=this.report.todayCustomerVisit[i];
//                        if(data.tel!=""&&data.entourage==""||data.tel!=""&&data.visitMode==""){
//                            alert("当日拜访情况中 拜访方式 陪同人员 为必填项！");
//                            return false;
//                        }
//                    }
//                    for(var i=0;i<this.report.todayCustomerTelVisit.length;i++){
//                        var data=this.report.todayCustomerTelVisit[i];
//                        if(data.tel!=""&&data.entourage==""||data.tel!=""&&data.visitMode==""){
//                            alert("当日拜访情况中 拜访方式 陪同人员 为必填项！");
//                            return false;
//                        }
//                    }
                //}
                if (this.isHasModule('todayVisitCustomerDebt')) {
                    for (var i = 0; i < this.report.todayVisitCustomer.length; i++) {
                        if ((this.report.todayVisitCustomer[i].otherVisitType && this.report.todayVisitCustomer[i].otherVisitType != '')
                            || (this.report.todayVisitCustomer[i].debtCondition && this.report.todayVisitCustomer[i].debtCondition != '')
                            || (this.report.todayVisitCustomer[i].name && this.report.todayVisitCustomer[i].name != '')) {
                            if (!this.report.todayVisitCustomer[i].tel) {
                                alert("请填写客户电话！");
                                return false;
                            }
                        }
                    }
                }
                if (this.isHasModule('todayVisitCustomerLetters')) {
                    for (var i = 0; i < this.report.todayVisitCustomer.length; i++) {
                        if ((this.report.todayVisitCustomer[i].otherVisitType && this.report.todayVisitCustomer[i].otherVisitType != '')
                            || (this.report.todayVisitCustomer[i].lettersCondition && this.report.todayVisitCustomer[i].lettersCondition != '')
                            || (this.report.todayVisitCustomer[i].name && this.report.todayVisitCustomer[i].name != '')) {
                            if (!this.report.todayVisitCustomer[i].tel) {
                                alert("请填写客户电话！");
                                return false;
                            }
                        }
                    }
                }

                if (getCurrentUser().roleName == "区域经理"&&this.isHasModule('tomorrowAMPlan')&&this.isHasModule('tomorrowPMPlan')) {
                    if (this.report.tomorrowAMPlan.content.trim() == '' || this.report.tomorrowPMPlan.content.trim() == '') {
                        alert("请填写第二天面访计划！")
                        return false;
                    }
                }

                if (this.isHasModule('todayVisitCustomer')) {
                    var visitNum = 0;
                    var arrDistinctCustomerTels = [];
                    var arrSameCustomerTels = [];
                    for (var i = 0; i < this.report.todayVisitCustomer.length; i++) {
                        if (this.report.todayVisitCustomer[i].tel) {
                            if ($.inArray(this.report.todayVisitCustomer[i].tel, arrDistinctCustomerTels) == -1) {
                                arrDistinctCustomerTels.push(this.report.todayVisitCustomer[i].tel);
                            } else {
                                arrSameCustomerTels.push(this.report.todayVisitCustomer[i].tel);
                            }
                        }
                    }
                    if (arrSameCustomerTels.length > 0) {
                        alert("面访/电访存在相同的客户电话:" + arrSameCustomerTels.join(",") + "，请删除");
                        return false;
                    }
                    for (var i = 0; i < this.report.todayVisitCustomer.length; i++) {
                        if (this.report.todayVisitCustomer[i].tel) {
                            if (!this.report.todayVisitCustomer[i].customerType) {
                                alert("请填写客户类型！");
                                return false;
                            }
                            if (!this.report.todayVisitCustomer[i].otherCondition.trim()) {
                                alert("请填写资金情况、竞争对手情况等！");
                                return false;
                            }
                            if (!this.report.todayVisitCustomer[i].source) {
                                alert("请填写客户来源！");
                                return false;
                            }
                            if (!this.report.todayVisitCustomer[i].name.trim()) {
                                alert("请填写客户姓名！");
                                return false;
                            }
                        }
                        if ((this.report.todayVisitCustomer[i].customerType && this.report.todayVisitCustomer[i].customerType != '')
                            || (this.report.todayVisitCustomer[i].otherCondition && this.report.todayVisitCustomer[i].otherCondition != '')
                            || (this.report.todayVisitCustomer[i].name && this.report.todayVisitCustomer[i].name != '')) {
                            if (!this.report.todayVisitCustomer[i].tel.trim()) {
                                alert("请填写客户电话！");
                                return false;
                            }
                        }
                        if (this.report.todayVisitCustomer[i].visitMode == '1') {
                            visitNum++;
                        }
                    }
                    console.log(visitNum)
                    if (this.report.visitLetterReason.content && this.report.visitLetterReason.content != '') {

                    } else {
                        if (getCurrentUser().roleName == "区域经理" && visitNum < this.faceTarget) {
                            alert("请填写未到达拜访量原因")
                            return false;
                        }
                    }
                }
                if (this.isHasModule("regionDirectorTodayWork")) {
                    for (var i = 0; i < this.report.regionDirectorWorkList.length; i++) {
                        if (this.report.regionDirectorWorkList[i].reiongManagerId != "" && this.report.regionDirectorWorkList[i].content == "") {
                            alert("请填写今日下属工作情况描述");
                            return false;
                        }
                    }
                }

                if (this.isHasModule("subordinateTodayWork")) {
                    for (var i = 0; i < this.report.subordinateWorkList.length; i++) {
                        if (this.report.subordinateWorkList[i].reiongManagerId != "" && this.report.subordinateWorkList[i].content == "") {
                            alert("请填写今日下属工作情况描述");
                            return false;
                        }
                    }
                }

                if (getCurrentUser().roleName == "区域经理" || getCurrentUser().roleName == "大区经理" || getCurrentUser().roleName == "大客户经理") {
                    var that = this;
                    $.wyui.postLoadMethod(urlConfig.intentionCustomerManagement.getCountRegionCustomerByUserIdAndReportDate, {
                        "userId": getCurrentUser().id,
                        "reportDate": this.report.main.reportDate,
                    }, function (data) {
                        that.count = data.count;
                        if(parseInt(data.count)>0){
                            var H = $(window).height() - 50;
                            top.$.dialog({
                                content: 'url:/page/intentionManagement/quYuIntentionallList.html?userId=' + getCurrentUser().id + '&&reportDate=' + that.report.main.reportDate,
                                title: '意向客户列表',
                                width: 600,
                                height: H,
                                max: true,
                                min: true,
                                lock: true,
                            });
                        } else {
                            $(".modleBj").show();
                            $(".saveModle").show();
                        }
                    }, false, true);
                } else {
                    $(".modleBj").show();
                    $(".saveModle").show();
                }
            },
//            isHasIntentionCustomer:function () {
//                var that = this;
//                $.wyui.postLoadMethod(urlConfig.intentionCustomerManagement.getCountRegionCustomerByUserIdAndReportDate, {
//                    "userId": getCurrentUser().id,
//                    "reportDate": that.report.main.reportDate,
//                }, function (data) {
//                    that.count = data.count;
//                },true,false);
//                console.log(that.count);
//                if(that.count>0){
//                    return true;
//                }else{
//                    return false;
//                }
//            },
            removeNull: function () {
                var list = this.report;
                for (var i = list.workOnTodayDescs.length - 1; i >= 0; i--) {
                    if (list.workOnTodayDescs[i].content == "") {
                        list.workOnTodayDescs.splice(i, 1);
                    }
                }
                if (list.workOnTodayDescsZjlNew) {
                    for (var i = list.workOnTodayDescsZjlNew.saleList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.saleList[i].content == "") {
                            list.workOnTodayDescsZjlNew.saleList.splice(i, 1);
                        }
                    }
                    for (var i = list.workOnTodayDescsZjlNew.serverList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.serverList[i].content == "") {
                            list.workOnTodayDescsZjlNew.serverList.splice(i, 1);
                        }
                    }
                    for (var i = list.workOnTodayDescsZjlNew.financeList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.financeList[i].content == "") {
                            list.workOnTodayDescsZjlNew.financeList.splice(i, 1);
                        }
                    }
                    for (var i = list.workOnTodayDescsZjlNew.diconList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.diconList[i].content == "") {
                            list.workOnTodayDescsZjlNew.diconList.splice(i, 1);
                        }
                    }
                    for (var i = list.workOnTodayDescsZjlNew.bondList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.bondList[i].content == "") {
                            list.workOnTodayDescsZjlNew.bondList.splice(i, 1);
                        }
                    }
                    for (var i = list.workOnTodayDescsZjlNew.personList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.personList[i].content == "") {
                            list.workOnTodayDescsZjlNew.personList.splice(i, 1);
                        }
                    }
                }

                for (var i = list.todayGatherSituation.length - 1; i >= 0; i--) {
                    if (list.todayGatherSituation[i].money == "") {
                        list.todayGatherSituation.splice(i, 1);
                    }
                }

                for (var i = list.todayCostDetail.length - 1; i >= 0; i--) {
                    if (list.todayCostDetail[i].money == "") {
                        list.todayCostDetail.splice(i, 1);
                    }
                }
                for (var i = list.unfinishes.length - 1; i >= 0; i--) {
                    if (list.unfinishes [i].trackContent == "") {
                        list.unfinishes.splice(i, 1);
                    }
                }
                return list;
            },
            saveGo: function () {
                var that = this;
                this.report.main.flage = "0";
                this.browserRedirect()
                // for (var i=0;i<that.report.todayVisitCustomer.length;i++){
                //     var checkedServerCustomerLists = "";
                //     for (var j = 0; j < (that.report.todayVisitCustomer[i].checkedServerCustomerLists).length; j++) {
                //         if (that.report.todayVisitCustomer[i].checkedServerCustomerLists[j]!=""){
                //             checkedServerCustomerLists += that.report.todayVisitCustomer[i].checkedServerCustomerLists[j] + ",";
                //         }
                //     }
                //     that.report.todayVisitCustomer[i].serverCustomerType=checkedServerCustomerLists.substring(0, checkedServerCustomerLists.length - 1);
                //
                // }
                if (this.report.receivers.length === 0) {
                    alert("请填写收件人！");
                    return false;
                }
                for (var i = 0; i < this.report.todayCostDetail2.length; i++) {
                    if (this.report.todayCostDetail2[i].money != "" || this.report.todayCostDetail2[i].remark != "" || this.report.todayCostDetail2[i].costBigName != "" || this.report.todayCostDetail2[i].costSmallName != "") {
                        if (this.report.todayCostDetail2[i].costBigName == "" || this.report.todayCostDetail2[i].costSmallName == "") {
                            alert("请填写费用类型！");
                            return false;
                        }

                    }
                }

                if (this.isHasModule('todayVisitCustomerService')) {
                    for (var i = 0; i < this.report.todayVisitCustomer.length; i++) {
                        this.report.todayVisitCustomer[i].type = "1";
                        if (this.report.todayVisitCustomer[i].tel) {
                            if (!this.report.todayVisitCustomer[i].serverCondition) {
                                alert("请填写服务内容！");
                                return false;
                            }
                        }
                    }
                }
                // for (var i = 0; i < this.report.workOnTodayDescsZjl.length; i++) {
                //     delete this.report.workOnTodayDescsZjl[i].createTime
                //     delete this.report.workOnTodayDescsZjl[i].arrivalsTime
                //     delete this.report.workOnTodayDescsZjl[i].leaveTime
                // }

                service.save(trimRN(this.removeNull()), function (r) {
                    if (!r.e.code) {
                        var pageId = top.getActivePageId();
                        console.log(pageId)
                        that.showModel(200, "发送成功")
                        //刷新列表
                        top.refreshTabByName("工作报告", "no");
//                            if (getCurrentUser().roleName == "区域经理"){
//                                top.addTabs({
//                                    id: "intentCustomerPc",
//                                    title: "意向客户管理",
//                                    close: true,
//                                    url: 'intentionManagement/intentCustomerPc/quYuIntentionalList.html'
//                                });
//                            }
                        setTimeout(function () {
                            top.closeTabByPageId(pageId);
                        }, 2000)
                    } else {
                        alert(r.e.desc);
                    }
                });

            },
            browserRedirect: function () {
                // var sUserAgent = navigator.userAgent.toLowerCase();
                // var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
                // var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
                // var bIsMidp = sUserAgent.match(/midp/i) == "midp";
                // var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
                // var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
                // var bIsAndroid = sUserAgent.match(/android/i) == "android";
                // var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
                // var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
                // if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
                //     //电脑
                //     this.report.main.type='0'
                // } else {
                //     //手机
                //     this.report.main.type='1'
                // }
                var os = function () {
                    var ua = navigator.userAgent,
                        isWindowsPhone = /(?:Windows Phone)/.test(ua),
                        isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone,
                        isAndroid = /(?:Android)/.test(ua),
                        isFireFox = /(?:Firefox)/.test(ua),
                        isChrome = /(?:Chrome|CriOS)/.test(ua),
                        isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)),
                        isPhone = /(?:iPhone)/.test(ua) && !isTablet,
                        isPc = !isPhone && !isAndroid && !isSymbian;
                    return {
                        isTablet: isTablet,
                        isPhone: isPhone,
                        isAndroid: isAndroid,
                        isPc: isPc
                    };
                }();
                console.log(os)
                if (os.isAndroid || os.isPhone) {
                    //alert("手机" );
                    this.report.main.type = '1'
                } else {
                    //alert("电脑,平板" );
                    this.report.main.type = '0'
                }
            },
            sendMessage: function () {
                var that = this;
                $.wyui.postMethod('/token/sendTextMsg.json', {
                    userIds: that.receiversUserIds,
                    content: getCurrentUser().name + "给你发送了工作报告，记得接收哦！"
                }, function (r) {
                    //刷新列表
                    var pageId = top.getActivePageId();
                    top.refreshTabByName("工作报告", "no");
                    top.closeTabByPageId(pageId);
                })

            },
            getGrade: function (type) {
                var that = this;
                $.wyui.postMethod('/enum2/selectByModuleType.json', {moduleType: type}, function (r) {
                    console.log(r)
                    for (var i = 0; i < r.length; i++) {
                        r[i].select = "0"
                    }
                    that.pingjia.pingjia = r
                    console.log(that.pingjia)
                }, true)
            },
            showDivModel: function (event, type) {
                console.log(event)
                this.divInModel = type;
                $("#selectModel").css({
                    "left": event.pageX,
                    "top": (event.pageY) + "px"
                }).show();

            },
            showDivEntourage: function (event, type) {
                console.log(event)
                this.divInEntourage = type;
                $("#entourage").css({
                    "left": event.pageX,
                    "top": (event.pageY) + "px"
                }).show();
            },
            hiddenDivModel: function () {
                $("#selectModel").hide();
            },
            getBran: function () {
                var that = this;
                var s = that.selectType;
                var d = that.selectCom;
                that.selectBran = "品牌";
                that.selectMod = "型号";
                that.itemsMod = "";
                var data = {};
                $.wyui.postMethod('/deviceModel/getBrand.json', data, function (r) {
                    console.log(r);
                    that.itemsBran = r.brands;
                })
            },
            getIntentionModel: function (type) {
                var that = this;
                that.report[type][that.currentfocus].intentionModel = $("#testMod option:selected").text();
                that.report[type][that.currentfocus].intentionDevice = $("#testType option:selected").text();
                that.report[type][that.currentfocus].intentionBrand = $("#testBran option:selected").text();
                $("#selectModel").hide();
            },
            addEntourage: function (a, type) {
                var that = this;
                if (type == 'tomorrowVisitPlan') {
                    that.report.tomorrowVisitPlan[that.currentfocus].customerName = a;
                }
                if (type == 'tomorrowVisitPlanBigRegion') {
                    that.report.tomorrowVisitPlan[that.currentfocus].entourage = a;
                }
                if (type == 'tomorrowVisitPlanRegion') {
                    that.report.tomorrowVisitPlan[that.currentfocus].entourage = a;
                }
                that.report.tomorrowVisitPlan.push({});
                that.report.tomorrowVisitPlan.splice(that.report.tomorrowVisitPlan.length - 1, 1);
                $("#entourage").hide();
            },
            getMod: function () {
                var that = this;
                var s = that.selectType;
                var d = that.selectBran;
                that.selectMod = "型号";
                var data = {'brandId': d, 'deviceTypeId': s};
                $.wyui.postMethod('/deviceModel/getModelListByBrandId.json', data, function (r) {
                    console.log(r);
                    that.itemsMod = r.models;
                })

            },
            getCity: function (id) {
                var that = this;
                $.wyui.postMethod('/intentCustomer/getForProvinceById.json', {'id': id}, function (r) {
                    that.cityList = r.records;
                })
            }
            ,
            getCounty: function (id) {
                var that = this;
                $.wyui.postMethod('/intentCustomer/getForProvinceById.json', {'id': id}, function (r) {
                    console.log(r);
                    that.countyList = r.records;
                })

            },
            gotoDetail: function (id) {
                $.dialog({
                    content: 'url:temporaryExpenses.html?id=' + id,
                    title: "临时费用详情",
                    width: 904,
                    height: 365,
                    max: true,
                    min: true,
                    lock: true
                });
            },
            spliceString: function (evaluation, otherDescription) {
                if (evaluation.indexOf("|") != -1) {
                    return evaluation.replace(/\|/gi, ";") + ";" + otherDescription
                } else {
                    if (evaluation && evaluation != "") {
                        return evaluation + ";" + otherDescription
                    } else {
                        return otherDescription
                    }
                }
            },
            showModel: function (width, title) {
                $.alert({type: 'topAlert', width: width, title: title})
//                var txt = "hello World 弹框内容";
//                top.$.alert({
//                    win:this,
//                    height:220,
//                    icon:'1', //1成功 2失败 3提示 不穿代表无图标
//                    title:'弹框标题',
//                    content: '<p>' + txt +'</p>',
//                    effect: $(event.currentTarget).attr('data-flag'),
//                    blankclose: true,//点击空白是否可关闭
//                    ok:"确定",//是否显示确认按钮,
//                    okCallback:function () {
//                        //确认按钮回调
//                        console.log(this)
//                        console.log("确定回调")
//                        console.log(this.win.myWorkList)
//                    },
//                    cancel:"取消"
//                })
            },
            saveTraft: function () {
                var that = this;
                this.report.main.flage = "-1";
                // for (var i=0;i<this.report.todayVisitCustomer.length;i++){
                //     var checkedServerCustomerLists = "";
                //     for (var j = 0; j < (this.report.todayVisitCustomer[i].checkedServerCustomerLists).length; j++) {
                //         if (this.report.todayVisitCustomer[i].checkedServerCustomerLists[j]!=""){
                //             checkedServerCustomerLists += this.report.todayVisitCustomer[i].checkedServerCustomerLists[j] + ",";
                //         }
                //     }
                //     this.report.todayVisitCustomer[i].serverCustomerType=checkedServerCustomerLists.substring(0, checkedServerCustomerLists.length - 1);
                //
                // }
                this.browserRedirect()
                if (this.report.workOnTodayDescsZjlNew) {
                    for (var i = this.report.workOnTodayDescsZjlNew.saleList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.saleList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.saleList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.serverList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.serverList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.serverList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.financeList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.financeList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.financeList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.diconList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.diconList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.diconList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.bondList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.bondList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.bondList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.personList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.personList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.personList.splice(i, 1);
                        }
                    }
                }


                for (var i = this.report.todayGatherSituation.length - 1; i >= 0; i--) {
                    if (this.report.todayGatherSituation[i].money == "") {
                        this.report.todayGatherSituation.splice(i, 1);
                    }
                }

                // for (var i = 0; i < this.report.workOnTodayDescsZjl.length; i++) {
                //     delete this.report.workOnTodayDescsZjl[i].createTime
                //     delete this.report.workOnTodayDescsZjl[i].arrivalsTime
                //     delete this.report.workOnTodayDescsZjl[i].leaveTime
                // }
                console.log(trimRN(this.report));
                service.save(trimRN(this.report), function (r) {
                    if (!r.e.code) {
                        top.refreshTabByName("工作报告", "no");
                        that.showModel(200, "保存成功")
                    } else {
                        alert(r.e.desc);
                    }
                });
            }
        },

        mounted: function () {
            var that = this;
            $.wyui.postLoadMethod(urlConfig.system.user.getUserViewById, {id: getCurrentUser().id}, function (r) {
                console.log(r);
                var obj = {};
                obj.companyId = r.companyId;
                obj.companyName = r.companyName;
                obj.departId = r.departId;
                obj.departName = r.departName;
                obj.id = r.id;
                obj.imagerUrl = r.imagerUrl;
                obj.jobState = r.jobState;
                obj.name = r.name;
                obj.pwd = r.pwd;
                obj.roleId = r.roleId;
                obj.roleName = r.roleName;
                obj.roleNameId = r.roleNameId;
                obj.spell = r.spell;
                obj.superUser = r.superUser;
                obj.tel = r.tel;
                obj.wechatDepartId = r.wechatDepartId;
                obj.wxId = r.wxId;
                obj.card = r.card;
                obj.leaderFlag = r.leaderFlag;
                obj.frontFlag = r.frontFlag;
                setCurrentUser(obj)
            }, true, false);
            $.wyui.postLoadMethod('/intentCustomer/getForProvinceById.json', {'id': '0'}, function (r) {
                console.log(r);
                that.provinceList = r.records;
            }, false, false)
            this.currentUserTel = getCurrentUser().tel;

            if (this.currentUserTel == '15034156981') {
                this.getAllTemplates();
            }
            //判断有没有传过来的id
            //判断页面状态

            $.wyui.postLoadMethod('/wreport/getTarget.json', {userId: getCurrentUser().id}, function (r) {
                that.faceTarget = r.faceTarget
                console.log(r.faceTarget)
            }, false, false)
            $.wyui.postLoadMethod('/user/getEntourage.json', {userId: getCurrentUser().id}, function (r) {
                that.entourage = r;
                if (!that.entourage) {
                    that.entourage = []
                }
                that.entourage.push({"name": "无"});
            }, false, false)
            if (that.pingjia.evaluation == "合格") {
                //查询合格的enum
                that.getGrade("pingjia")
            }
            if (that.pingjia.evaluation == "不合格") {
                that.getGrade("pingjia1")
            }
            $.wyui.postLoadMethod('/enum2/selectByModuleType.json', {moduleType: 'serviceType'}, function (r) {
                that.serverVisitType = r;
            }, false, false)
            $.wyui.postLoadMethod('/enum2/selectByModuleType.json', {moduleType: 'serverCustomerType'}, function (r) {
                that.serverCustomerType = r;
            }, false, false)
            $.wyui.postLoadMethod('/enum2/selectByModuleType.json', {moduleType: 'lettersType'}, function (r) {
                that.lettersVisitType = r;
            }, false, false)
            $.wyui.postLoadMethod('/enum2/selectByModuleType.json', {moduleType: 'debtType'}, function (r) {
                that.debtVisitType = r;
            }, false, false)
            $.wyui.postLoadMethod('/enum2/selectByModuleType.json', {moduleType: 'feeType'}, function (r) {
                that.feeType = r;
            }, false, false)
            $.wyui.postLoadMethod('/wreport/getCustomerType.json', {}, function (r) {
                that.customerType = r;
            }, false, false)
            $.wyui.postLoadMethod('/deviceBrand/getDeviceTypeList.json', {}, function (r) {
                that.itemsType = r.devicetypes;
            }, false, false)
            service.getExpensesByParentId({parentId: 0, userId: getCurrentUser().id}, function (data) {
                that.costBigNameList = data;
            });
            if ($.wyui.page.urlParams.id) {
                this.pageType = 'browser';
                service.getById({id: $.wyui.page.urlParams.id}, function (data) {
                    that.pingjiaFlag = 'true'
                    //处理换行
                    data.workOnTodayDescs = getBr(data.workOnTodayDescs);
                    data.unfinishes = getBr(data.unfinishes);
                    data.weekPlan = [];
                    if (data.todayVisitCustomer) {
                        for (var i = 0; i < data.todayVisitCustomer.length; i++) {
                            if (data.todayVisitCustomer[i].serverCustomerType) {
                                data.todayVisitCustomer[i].checkedServerCustomerLists = data.todayVisitCustomer[i].serverCustomerType.split(",");
                            } else {
                                data.todayVisitCustomer[i].checkedServerCustomerLists = [];
                            }
                        }
                    }
                    that.report = reportCountFixed(data);
                    that.report.mian = data.mian
                    that.getreceiver();
                    console.log(that.report)
                    if (that.isHasModule('weekVisitPlan')) {
                        $.wyui.postMethod('/weekPlan/getWeek.json', {
                            createUserId: that.report.main.userId,
                            reportDate: that.report.main.reportDate,
                        }, function (r) {
                            console.log(r);
                            that.report.weekPlan = that.tablesMergeCell(r.records);
                        })
                    }
                    $.wyui.postLoadMethod('/wreport/getPingjiaList.json', {
                        'reportDate': that.report.main.reportDate,
                        'sendUserId': that.report.main.userId,
                    }, function (r) {
                        console.log(that.pingjia)
                        //查看是当前的报告评价
                        if (r.yesTodayList) {
                            that.commentList = r.yesTodayList
                        } else {
                            that.commentList = []
                        }

                        that.commentTitle = "本次评价描述"
                        if (r.yesToday) {
                            that.commentTishi = r.yesToday
                        }
                        that.pingjiaNum = that.getNum(that.report.main.moduleENames)
                        if (that.pingjiaNum < 0) {
                            that.leftNum = that.leftNum + Math.abs(that.pingjiaNum)
                        }
                    }, false, false)
                    /*
                     for (var i = 0; i < that.report.jobDescriptionForBranch.length; i++) {
                     if (that.report.jobDescriptionForBranch[i].branchName != "") {
                     that.inferiorNameList.push({name: that.report.jobDescriptionForBranch[i].branchName});
                     }
                     }*/
                });
                //获取评价
                $.wyui.postLoadMethod('/wreport/getPingjia.json', {
                    'createUserId': getCurrentUser().id,
                    'dataId': $.wyui.page.urlParams.id
                }, function (r) {
                    console.log(r);
                    var data = r.pingjia;
                    if ((r.pingjia && r.pingjia.grade != "") || (r.pingjia && r.pingjia.otherDescription != "")) {
                        that.isComment = "1"
                    }
                    if (data) {
                        if (data.evaluation != "") {
                            that.pingjia.pingjiaList = data.evaluation.split("|");
                        } else {
                            that.pingjia.pingjiaList = []
                        }
                        that.pingjia.pingjiaStrings = data.evaluation
                        that.pingjia.otherDescription = data.otherDescription
                        that.pingjia.evaluation = data.grade
                        if (data.grade == '合格') {
                            that.getGrade("pingjia")
                        }
                        if (that.pingjia.evaluation == "不合格") {
                            that.getGrade("pingjia1")
                        }
                        for (var i = 0; i < that.pingjia.pingjia.length; i++) {
                            if (that.pingjia.pingjiaStrings.indexOf(that.pingjia.pingjia[i].value) != -1) {
                                that.pingjia.pingjia[i].select = "1";
                            } else {
                                that.pingjia.pingjia[i].select = "0"
                            }
                        }
                        console.log(that.pingjia.pingjiaStrings)
                    }
                }, false, false)
                //记录收件人/抄送人第一次查看工作报告时间及关闭时间
                if (that.wreportUserId && that.wreportUserId != that.userId) {
                    $.wyui.postLoadMethod('/module/getWhetherFirstReading.json',
                        {
                            wid: $.wyui.page.urlParams.id,
                            userId: getCurrentUser().id
                        },
                        function (r) {
                            if (!r) {
                                $.wyui.postLoadMethod('/module/saveReordTime.json',
                                    {
                                        dataId: $.wyui.page.urlParams.id,
                                        createUserId: getCurrentUser().id,
                                        createUserName: getCurrentUser().name
                                    }, function (r) {
                                        console.log(r.id)
                                    }, false, false
                                )
                            }
                        }, false, false)
                }
            } else {
                $.wyui.postLoadMethod(urlConfig.system.user.getInferiorByParentId, {parentId: getCurrentUser().id}, function (r) {
                    that.inferiorNameList = r;
                }, false, false);
                var date = (new Date()).Format("yyyy-MM-dd");
                var dateYesterday = new Date();
                dateYesterday.addDays(-1);
                service.getByUserIdAndReportDate({
                    userId: $.wyui.page.urlParams.userId,
                    reportDate: $.wyui.page.urlParams.reportDate
                }, function (data) {
                    this.pageType = "edit";
                    that.pingjiaFlag = 'true';
                    that.report.todayCostDetail = data.todayCostDetail;
                    // that.report.workOnTodayDescsZjl = data.workOnTodayDescsZjl;
                    if (data.main != null) {
                        that.report.workOnTodayDescsZjlNew = data.workOnTodayDescsZjlNew;
                        var subordinateWorkList = data.subordinateWorkList;
                        if (subordinateWorkList) {
                            for (var i = 0; i < subordinateWorkList.length; i++) {
                                if (subordinateWorkList[i].reiongManagerId && !subordinateWorkList[i].haveAccompany) {
                                    subordinateWorkList[i].haveAccompany = '否';
                                }
                            }
                        }
                        that.report.subordinateWorkList = subordinateWorkList;
                        that.report.regionDirectorWorkList = data.regionDirectorWorkList;
                        $.wyui.postLoadMethod(urlConfig.wreport.wreport.getReceiverAndCopiers, {
                            userId: getCurrentUser().id,
                        }, function (emailReceiver) {
                            data.receivers = emailReceiver.receivers;
                            data.copiers = emailReceiver.copiers;
                            var receiversids = "";
                            for (i = 0; i < emailReceiver.receivers.length; i++) {
                                receiversids = receiversids + emailReceiver.receivers[i].userId + "|";

                            }
                            that.receiversUserIds = receiversids.slice(0, receiversids.length - 1);
                            for (i = 0; i < emailReceiver.copiers.length; i++) {
                                receiversids = receiversids + emailReceiver.copiers[i].userId + "|";

                            }
                            that.deleteList = receiversids.slice(0, receiversids.length - 1);
                            data.handAddReceivers = emailReceiver.handAddReceivers;
                            data.handAddCopiers = emailReceiver.handAddCopiers;
                            for (i = 0; i < emailReceiver.handAddReceivers.length; i++) {
                                if (that.deleteList.indexOf(emailReceiver.handAddReceivers[i].userId) == -1) {
                                    data.receivers.push(emailReceiver.handAddReceivers[i]);
                                }
                            }
                            for (i = 0; i < emailReceiver.handAddCopiers.length; i++) {
                                if (that.deleteList.indexOf(emailReceiver.handAddCopiers[i].userId) == -1) {
                                    data.copiers.push(emailReceiver.handAddCopiers[i]);
                                }
                            }
                            console.log(data.todayVisitCustomer)
                            for (var i = 0; i < data.todayVisitCustomer.length; i++) {
                                if (data.todayVisitCustomer[i].serverCustomerType) {
                                    data.todayVisitCustomer[i].checkedServerCustomerLists = data.todayVisitCustomer[i].serverCustomerType.split(",");
                                } else {
                                    data.todayVisitCustomer[i].checkedServerCustomerLists = [];
                                }
                            }
                            that.report = reportCountFixed(data);
                            console.log(that.report)
                            var preDate = that.getNextDate(that.report.main.reportDate, -1)
                            $.wyui.postMethod('/wreport/getPingjiaList.json', {
                                'reportDate': preDate,
                                'sendUserId': that.report.main.userId,
                            }, function (r) {
                                console.log(r);
                                //查看是当前的报告评价
                                if (r.yesTodayList) {
                                    that.commentList = r.yesTodayList
                                } else {
                                    that.commentList = []
                                }
                                that.commentTitle = "上次评价描述"
                                if (r.yesToday) {
                                    that.commentTishi = r.yesToday
                                }
                                that.pingjiaNum = that.getNum(that.report.main.moduleENames)
                                if (that.pingjiaNum < 0) {
                                    that.leftNum = that.leftNum + Math.abs(that.pingjiaNum)
                                }
                            })
                        }, false, false);
                        data.weekPlan = [];
                        $.wyui.postLoadMethod('/weekPlan/getWeek.json', {
                            reportDate: $.wyui.page.urlParams.reportDate,
                            createUserId: getCurrentUser().id
                        }, function (r) {
                            data.weekPlan = that.tablesMergeCell(r.records);
                        }, false, false);

                    } else {
                        that.report.main.userId = getCurrentUser().id;
                        var subordinateWorkList = data.subordinateWorkList;
                        if (subordinateWorkList) {
                            for (var i = 0; i < subordinateWorkList.length; i++) {
                                if (subordinateWorkList[i].reiongManagerId && !subordinateWorkList[i].haveAccompany) {
                                    subordinateWorkList[i].haveAccompany = '否';
                                }
                            }
                        }
                        that.report.subordinateWorkList = subordinateWorkList;
                        that.report.regionDirectorWorkList = data.regionDirectorWorkList;
                        that.report.todayCustomerVisit = data.todayCustomerVisit;
                        that.report.todayCustomerTelVisit = data.todayCustomerTelVisit;
                        that.report.todayVisitCustomer = data.todayVisitCustomer;
                        console.log(that.report.todayVisitCustomer)
                        for (var i = 0; i < data.todayVisitCustomer.length; i++) {
                            if (data.todayVisitCustomer[i].serverCustomerType) {
                                that.report.todayVisitCustomer[i].checkedServerCustomerLists = data.todayVisitCustomer[i].serverCustomerType.split(",");
                            } else {
                                that.report.todayVisitCustomer[i].checkedServerCustomerLists = [];

                            }
                        }
//                        that.report.todayVisitCustomerBigRegion = data.todayVisitCustomerBigRegion;
                        if (data.unfinishes) {
                            that.report.unfinishes = data.unfinishes;
                        }
                        if (getCurrentUser().roleName == "大区经理") {
                            if (that.dateReissueEnd == 'true') {
                                that.report.main.title = $.wyui.page.urlParams.reportDate + getCurrentUser().roleName + '工作报告' + '(' + getCurrentUser().name + '-大区)' + '【补】';
                            } else {
                                that.report.main.title = $.wyui.page.urlParams.reportDate + getCurrentUser().roleName + '工作报告' + '(' + getCurrentUser().name + '-大区)';
                            }
                        } else if (getCurrentUser().roleName == "区域经理" || getCurrentUser().roleName == "大客户经理") {
                            $.wyui.postMethod(urlConfig.system.region.getRegionByWreport, {
                                userId: getCurrentUser().id,
                                roleName: getCurrentUser().roleName
                            }, function (r) {
                                if (r.roleNames) {

                                    if (that.dateReissueEnd == 'true') {
                                        that.report.main.title = $.wyui.page.urlParams.reportDate + getCurrentUser().roleName + '工作报告' + '(' + getCurrentUser().name + '-' + r.roleNames + ')' + '【补】';
                                    } else {
                                        that.report.main.title = $.wyui.page.urlParams.reportDate + getCurrentUser().roleName + '工作报告' + '(' + getCurrentUser().name + '-' + r.roleNames + ')';
                                    }
                                } else {
                                    if (that.dateReissueEnd == 'true') {
                                        that.report.main.title = $.wyui.page.urlParams.reportDate + getCurrentUser().roleName + '工作报告' + '(' + getCurrentUser().name + ')' + '【补】';
                                    } else {
                                        that.report.main.title = $.wyui.page.urlParams.reportDate + getCurrentUser().roleName + '工作报告' + '(' + getCurrentUser().name + ')';
                                    }
                                }
                            });
                        } else {
                            if (that.dateReissueEnd == 'true') {
                                that.report.main.title = $.wyui.page.urlParams.reportDate + " " + getCurrentUser().roleName + '工作报告' + '(' + getCurrentUser().name + ')' + '【补】';
                            } else {
                                that.report.main.title = $.wyui.page.urlParams.reportDate + " " + getCurrentUser().roleName + '工作报告' + '(' + getCurrentUser().name + ')';
                            }
                        }

                        that.report.main.reportDate = $.wyui.page.urlParams.reportDate;
                        service.getModuleENamesByUserId({userId: getCurrentUser().id}, function (data) {
                            var eNames = [];
                            for (var i = 0; i < data.length; i++) {
                                eNames.push(data[i].eName);
                            }
                            that.report.main.moduleENames = eNames.join(',');
                            console.log(that.report)
                            that.report = reportCountFixed(that.report);

                            var preDate = that.getNextDate(that.report.main.reportDate, -1)
                            $.wyui.postLoadMethod('/wreport/getPingjiaList.json', {
                                'reportDate': preDate,
                                'sendUserId': that.report.main.userId
                            }, function (r) {
                                console.log(r);
                                //查看是当前的报告评价
                                if (r.yesTodayList) {
                                    that.commentList = r.yesTodayList
                                } else {
                                    that.commentList = []
                                }
                                that.commentTitle = "上次评价描述"
                                if (r.yesToday) {
                                    that.commentTishi = r.yesToday
                                }
                                that.pingjiaNum = that.getNum(that.report.main.moduleENames)
                                if (that.pingjiaNum < 0) {
                                    that.leftNum = that.leftNum + Math.abs(that.pingjiaNum)
                                }

                            }, false, false)

                        });
                        $.wyui.postLoadMethod(urlConfig.wreport.wreport.getReceiverAndCopiers, {
                            userId: getCurrentUser().id,
                        }, function (emailReceiver) {
                            that.report.receivers = emailReceiver.receivers;
                            that.report.copiers = emailReceiver.copiers;
                            var receiversids = "";
                            for (i = 0; i < emailReceiver.receivers.length; i++) {
                                receiversids = receiversids + emailReceiver.receivers[i].userId + "|";
                            }
                            that.receiversUserIds = receiversids.slice(0, receiversids.length - 1);
                            for (i = 0; i < emailReceiver.copiers.length; i++) {
                                receiversids = receiversids + emailReceiver.copiers[i].userId + "|";
                            }
                            that.deleteList = receiversids.slice(0, receiversids.length - 1);
                            that.report.handAddReceivers = emailReceiver.handAddReceivers;
                            that.report.handAddCopiers = emailReceiver.handAddCopiers;
                            for (i = 0; i < emailReceiver.handAddReceivers.length; i++) {
                                if (that.deleteList.indexOf(that.report.handAddReceivers[i].userId) == -1) {
                                    that.report.receivers.push(emailReceiver.handAddReceivers[i]);
                                }
                            }
                            for (i = 0; i < emailReceiver.handAddCopiers.length; i++) {
                                if (that.deleteList.indexOf(that.report.handAddCopiers[i].userId) == -1) {
                                    that.report.copiers.push(emailReceiver.handAddCopiers[i]);
                                }

                            }

                        }, false, false);
                        if (getCurrentUser().roleName == "区域经理" || getCurrentUser().roleName == "大区经理" || getCurrentUser().roleName == "区域总监") {
                            that.initData();
                        }


                    }
//                    setTimeout(function () {
//                        $("#modal").hide();
//                    },500);
                    that.endLoad = 'true';
                    /*setTimeout(function () {
                     $(".table-report,.report-title,.div-btn").show();
                     },500);*/
                });
            }

        }
    });

    function renderLines(el, lineIndex) {

        $(".txtParent").eq(lineIndex).autoComplete({
            url: server.ip + "/weekPlan/getNameAndTel.json",
            render: function (r, panel) {
                for (var i = 0; i < r.length; i++) {
                    $("<li></li>").data("autoComplete",
                        r[i]).html("<a>" + r[i].customerName + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + r[i].customerTel + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (r) {
                app.report.tomorrowVisitPlan[app.currentfocus].customerName = r.customerName;
                app.report.tomorrowVisitPlan[app.currentfocus].customerAddress = r.customerAddress;
                app.report.tomorrowVisitPlan[app.currentfocus].lastVisitTime = r.lastVisitTime;
                app.report.tomorrowVisitPlan[app.currentfocus].customerIndustry = r.customerIndustry;
                app.report.tomorrowVisitPlan[app.currentfocus].intentionDevice = r.intentionDevice;
                return false;
            },
            extraParams: {createUserId: getCurrentUser().id},
            height: 210,
            width: 300
        });
    }

    Vue.directive('line-inserted', {
        inserted: function (el, binding) {
            console.log(el);
            var lineIndex = binding.value;
            renderLines(el, lineIndex);
        }
    });
    $(function () {
        $(".saveModle").show();
        $("#txtReceiver,#txtCopier").autoComplete({
            url: server.ip + urlConfig.system.user.getTop10ByNameUser,
            render: function (users, panel) {
                for (var i = 0; i < users.length; i++) {
                    $("<li></li>").data("autoComplete",
                        users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (user) {
                var receiverIds = new Array();
                for (var i = 0; i < app.report.receivers.length; i++) {
                    receiverIds.push(app.report.receivers[i].userId);
                }
                for (var i = 0; i < app.report.copiers.length; i++) {
                    receiverIds.push(app.report.copiers[i].userId);
                }

                if ($.inArray(user.id, receiverIds) > -1) {
                    alert("收件人或抄送人重复");
                    $(this).val("");
                    return false;
                } else {
                    if (this.id == "txtReceiver") {
                        app.report.receivers.push({userId: user.id, userName: user.name});
                        app.report.handAddReceivers.push({userId: user.id, userName: user.name});
                    } else {
                        app.report.copiers.push({userId: user.id, userName: user.name});
                        app.report.handAddCopiers.push({userId: user.id, userName: user.name});

                    }
                    $(this).val("");
                    return false;
                }
            },
            height: 210,
            width: 320,
            top: 0,
            left: 0
        });
        $(".saveModle").hide();
    });


    //修正工作报告各个模块的默认行数
    function reportCountFixed(report) {
        console.log(report)
        var tomorrowVisitPlanNumber = '';
        if (report.tomorrowVisitPlan != null) {
            if (report.tomorrowVisitPlan.length <= 6) {
                tomorrowVisitPlanNumber = 6
            }
        }
        if (report.tomorrowVisitPlan) {
            for (var i = report.tomorrowVisitPlan.length; i < tomorrowVisitPlanNumber; i++) {
                report.tomorrowVisitPlan.push(new Template.TomorrowVisitPlan());
            }
        }
        if (report.troubleShooting) {
            for (var i = report.troubleShooting.length; i < 3; i++) {
                report.troubleShooting.push(new Template.Unfinish('1'));
            }
        }
        if (report.forSupportMatters) {
            for (var i = report.forSupportMatters.length; i < 2; i++) {
                report.forSupportMatters.push(new Template.Unfinish('2'));
            }
        }
        var num = 5;
        if (getCurrentUser().roleName == "大客户总监" || app.pageType == "browser") {
            num = 1;
            if (report.todayCustomerVisit) {
                for (var i = report.todayCustomerVisit.length; i < 1; i++) {
                    report.todayCustomerVisit.push(new Template.CustomerSaler());
                }
            }
        } else {
            num = 5

        }
        var newNum = 5;
        console.log(report.main)
        if (report.main) {
            console.log(report.main.moduleENames.indexOf("todayVisitCustomer") != -1)
            if (report.main.moduleENames.indexOf("todayVisitCustomerLetters") != -1 ||
                report.main.moduleENames.indexOf("todayVisitCustomerService") != -1 ||
                report.main.moduleENames.indexOf("todayVisitCustomer") != -1 ||
                report.main.moduleENames.indexOf("todayVisitCustomerDebt") != -1) {
                newNum = 3;
            } else {
                newNum = 5
            }
        }
        if (report.todayCustomerTelVisit == null || report.todayCustomerTelVisit.length == 0) {
            for (var i = report.todayCustomerTelVisit.length; i < num; i++) {
                report.todayCustomerTelVisit.push(new Template.CustomerSalerTel());
            }
        }
        if (report.todayVisitCustomer && report.todayVisitCustomer != ' ') {
            for (var i = report.todayVisitCustomer.length; i < 5; i++) {
                report.todayVisitCustomer.push(new Template.CustomerSalerVisit());
            }
        }
//        if (report.todayVisitCustomerBigRegion == null || report.todayVisitCustomerBigRegion.length == 0) {
//            for (var i = report.todayVisitCustomerBigRegion.length; i < 1; i++) {
//                report.todayVisitCustomerBigRegion.push(new Template.CustomerSalerVisitRegion());
//            }
//        }
        console.log(newNum)
        for (var i = report.workOnTodayDescs.length; i < newNum; i++) {
            report.workOnTodayDescs.push(new Template.WorkOnTodayDesc());
        }
        // for (var i = report.workOnTodayDescsZjl.length; i < 3; i++) {
        //     report.workOnTodayDescsZjl.push(new Template.WorkOnTodayDescsZjl());
        // }


        for (var i = report.workOnTodayDescsZjlNew.saleList.length; i < 3; i++) {
            report.workOnTodayDescsZjlNew.saleList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.workOnTodayDescsZjlNew.serverList.length; i < 1; i++) {
            report.workOnTodayDescsZjlNew.serverList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.workOnTodayDescsZjlNew.financeList.length; i < 1; i++) {
            report.workOnTodayDescsZjlNew.financeList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.workOnTodayDescsZjlNew.diconList.length; i < 1; i++) {
            report.workOnTodayDescsZjlNew.diconList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.workOnTodayDescsZjlNew.bondList.length; i < 1; i++) {
            report.workOnTodayDescsZjlNew.bondList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.workOnTodayDescsZjlNew.personList.length; i < 1; i++) {
            report.workOnTodayDescsZjlNew.personList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.unfinishes.length; i < 3; i++) {
            report.unfinishes.push(new Template.Unfinish('3'));
        }
        for (var i = report.todayCostDetail2.length; i < 5; i++) {
            report.todayCostDetail2.push(new Template.Cost());
        }
        for (var i = report.jobDescriptionForBranch.length; i < 3; i++) {
            report.jobDescriptionForBranch.push(new Template.Branch());
        }
        for (var i = report.todayGatherSituation.length; i < 5; i++) {
            report.todayGatherSituation.push(new Template.Gather());
        }
        return report;
    }
</script>
</body>
</html>